I have the P102_PZEM004Tv3 plugin working perfectly. But I need all six fields available and the plugin only offers four Output Configuration per device.
Question:
What is the reason for not making all Output Configuration fields available in the plugin?
Would just adding two more fields in _P102_PZEM004Tv3.ino ( # define P102_QUERY5) and (# define P102_QUERY6) for example solve the problem?
Is there a way to configure unavailable fields in rules and forward them through the controller? In my case I use zabbix.
Add two fields in Output Configuration plugin P102_PZEM004Tv3
Moderators: grovkillen, Stuntteam, TD-er
Add two fields in Output Configuration plugin P102_PZEM004Tv3
- Attachments
-
- teste.jpg (141.18 KiB) Viewed 1504 times
Re: Add two fields in Output Configuration plugin P102_PZEM004Tv3
You can add another task with that device and configure the other values, they will be sent separately to Zabbix.
That will overwrite the first 2 values of the next task, and when configured as the last task, possibly cause crashes because it accesses memory it isn't supposed to access.
And please keep in mind that some devices have 100+ values to pick from...
Currently it's not possible to retrieve not-configured values from this plugin, but you can add that as a feature request on Github.
Sending to a controller (or any external server/service) can be done from rules.
/Ton (PayPal.me)
Re: Add two fields in Output Configuration plugin P102_PZEM004Tv3
The main reason we can't just add more task values is the way how settings are stored.
If you need to increase the number of task values, you also need to change the settings structure.
This will render it completely incompatible with existing settings and also a lot of code needs to be checked to see if we use the same define in all places.
Also some structs have their bits packed really tight and I'm 100% sure that wherever that's being packed is not dynamically updated when the define for number of task values is changed.
So changing the number of task values is not as simple as just changing a define.
However for some plugins we have added some extra options to access other registers too.
For example the Eastron plugin allows multiple instances of the same plugin and being configured for the same serial port and modbus address. This way you can access other registers too. (The SDM630 has about 100 registers with data)
For other plugins, which get all the available sample data anyway without asking, like GPS and PMSx003, we have added "virtual" task values.
So for example if you only have latitude/longitude/speed/altitude configured, you can still access the other values like [gps#hdop] (assuming your task is called "gps")
You could test to see if the PZEM004 plugin already has been updated to have multiple instances of the same plugin, like on the Eastron.
If not, then I guess that would by far be the best option.
Problem with Modbus devices is that you actively need to query data. So you can't "fetch all and pick whatever you like" as that would waste quite a lot of resources.
If you need to increase the number of task values, you also need to change the settings structure.
This will render it completely incompatible with existing settings and also a lot of code needs to be checked to see if we use the same define in all places.
Also some structs have their bits packed really tight and I'm 100% sure that wherever that's being packed is not dynamically updated when the define for number of task values is changed.
So changing the number of task values is not as simple as just changing a define.
However for some plugins we have added some extra options to access other registers too.
For example the Eastron plugin allows multiple instances of the same plugin and being configured for the same serial port and modbus address. This way you can access other registers too. (The SDM630 has about 100 registers with data)
For other plugins, which get all the available sample data anyway without asking, like GPS and PMSx003, we have added "virtual" task values.
So for example if you only have latitude/longitude/speed/altitude configured, you can still access the other values like [gps#hdop] (assuming your task is called "gps")
You could test to see if the PZEM004 plugin already has been updated to have multiple instances of the same plugin, like on the Eastron.
If not, then I guess that would by far be the best option.
Problem with Modbus devices is that you actively need to query data. So you can't "fetch all and pick whatever you like" as that would waste quite a lot of resources.
Re: Add two fields in Output Configuration plugin P102_PZEM004Tv3
Configured and working perfectly this way. Thank you very much for the answers.
- Attachments
-
- config_alt.jpg (258.29 KiB) Viewed 1476 times
Who is online
Users browsing this forum: No registered users and 2 guests