Import Electric data to domoticz electric(instant+counter)
Moderator: leecollings
-
- Posts: 3
- Joined: Wednesday 01 August 2018 20:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Import Electric data to domoticz electric(instant+counter)
Hi . I am trying to import sensor data, electricity reading from node red to domoticz. Right now I have 2 dummy sensors general purpose which recives mqtt data from node red to display instant energy consumption and energy counter . This works fine, my problem now is that I am trying to merge those 2 values to 1 dummy sensor "electric(instant+counter)" . I can't seem to get the mqtt syntax right because I get no value on the new sensor when trying to send data. This is what I send to domoticz/in from node red with my general purpose sensor :
{ "idx" : 5041, "nvalue" : {{payload}}, "svalue" : "{{payload}}" }
Im trying to send the same to the electric dummy sensor but I get no value on that one. Anyone knew what I am doing wrong ?
//Mikael
{ "idx" : 5041, "nvalue" : {{payload}}, "svalue" : "{{payload}}" }
Im trying to send the same to the electric dummy sensor but I get no value on that one. Anyone knew what I am doing wrong ?
//Mikael
-
- Posts: 3
- Joined: Wednesday 01 August 2018 20:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
I got it working . tnx anyway
- JustDude
- Posts: 16
- Joined: Thursday 23 February 2023 18:15
- Target OS: Linux
- Domoticz version: Latest
- Location: NL
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
I just had the same question,,, looking for the right value to store the value from Node-red.
I tried svalue, usage, consumed. Nothing works as I would expect.
Is there a datamodel or approach on where to find the correct way?
By the way: Would be nice if you know the solution to let (me) us and other readers know
I tried svalue, usage, consumed. Nothing works as I would expect.
Is there a datamodel or approach on where to find the correct way?
By the way: Would be nice if you know the solution to let (me) us and other readers know
---
Measuring is knowing
Measuring is knowing
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
There is a node-red subforum here : https://domoticz.com/forum/viewforum.php?f=81
The mqtt message should have the right mqtt format. Are you already able to update the sensor by sending an mqtt message manual?
See wiki https://www.domoticz.com/wiki/MQTT#MQTT_to_Domoticz
Edit: Electric
The electric sensor will show the current usage of electricity in Watt and the cumulative usage in kWh. You can add digits after the decimal if needed.
where us is usage in Watt and cu is cumulative usage in Wh (even though it is displayed in kWh)
The mqtt message should have the right mqtt format. Are you already able to update the sensor by sending an mqtt message manual?
See wiki https://www.domoticz.com/wiki/MQTT#MQTT_to_Domoticz
Edit: Electric
The electric sensor will show the current usage of electricity in Watt and the cumulative usage in kWh. You can add digits after the decimal if needed.
Code: Select all
{"command":"udevice", "idx":1234, "svalue":"us;cu"}
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- JustDude
- Posts: 16
- Joined: Thursday 23 February 2023 18:15
- Target OS: Linux
- Domoticz version: Latest
- Location: NL
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Thanks that helped. Found the Node-red subforum also.
---
Measuring is knowing
Measuring is knowing
-
- Posts: 39
- Joined: Thursday 24 February 2022 8:32
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Hi,
I am trying to do something similar. I've created an instantaneous electric virtual device and want to replace it with an electric (instant + counter) type, but the "instant + counter" device is not listed in the new device drop down menu from the "instantaneous" device. Is there any simple workaround? Thank you in advance.
Averter
I am trying to do something similar. I've created an instantaneous electric virtual device and want to replace it with an electric (instant + counter) type, but the "instant + counter" device is not listed in the new device drop down menu from the "instantaneous" device. Is there any simple workaround? Thank you in advance.
Averter
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Hello @averter,
You said:
Can you give more details?
I think, that you should create in "Hardware" a "Dummy (Does nothing, use for virtual switches only)".
After that you click "Create Virtual Sensors" and select "Electric (Instant + Counter)".
I think that is what you need.
Regards
You said:
I have no idea where and what you have created, being "an instantaneous electric virtual device".I've created an instantaneous electric virtual device
Can you give more details?
I think, that you should create in "Hardware" a "Dummy (Does nothing, use for virtual switches only)".
After that you click "Create Virtual Sensors" and select "Electric (Instant + Counter)".
I think that is what you need.
Regards
-
- Posts: 39
- Joined: Thursday 24 February 2022 8:32
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Hello @FireWizard,
Thanks and apologies for not being clear. I have one dummy hardware device and have created a virtual sensor of the type "usage (electric)": this is what I mean by instantaneous electric virtual device. It works fine, but it doesn't include an energy counter in kWh, only the kW instantaneous reading, hence why I would like to transfer its log to another virtual sensor of the type "electric (instant + counter)".
Thanks and apologies for not being clear. I have one dummy hardware device and have created a virtual sensor of the type "usage (electric)": this is what I mean by instantaneous electric virtual device. It works fine, but it doesn't include an energy counter in kWh, only the kW instantaneous reading, hence why I would like to transfer its log to another virtual sensor of the type "electric (instant + counter)".
-
- Posts: 621
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Is the kWh device set to "computed" or "from device" (using the edit button) ?
If set to computed, then domoticz will calculate the energy from the instantaneous values.
If set to computed, then domoticz will calculate the energy from the instantaneous values.
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Hi @averter,
Sorry, that I did not understand your own naming of a virtual "Usage" sensor.
Therefore you need a sensor of the type: "Electric (Instant + Counter)". but you have to upload also the cumulative usage in Wh.
But, as far as I know, to replace an old sensor for a new one, both have to be of the same type. However this is not the case, so I cannot guarantee any success.
Regards
Sorry, that I did not understand your own naming of a virtual "Usage" sensor.
A virtual sensor of the type "Usage" will show you the actual usage in Watt and not the Consumed or Produced Energy.I have one dummy hardware device and have created a virtual sensor of the type "usage (electric)": this is what I mean by instantaneous electric virtual device. It works fine, but it doesn't include an energy counter in kWh, only the kW instantaneous reading
Therefore you need a sensor of the type: "Electric (Instant + Counter)". but you have to upload also the cumulative usage in Wh.
But, as far as I know, to replace an old sensor for a new one, both have to be of the same type. However this is not the case, so I cannot guarantee any success.
Regards
-
- Posts: 39
- Joined: Thursday 24 February 2022 8:32
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Thanks for letting me know about that option, but my question sort of remains the same. How can I transfer all the instantaneous values from the "usage (electric)" device to the new "electric (instant + counter)" device? Thanks
-
- Posts: 39
- Joined: Thursday 24 February 2022 8:32
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
According to the previous reply from willemd it should be possible to calculate the cumulative usages by setting the "computed" instead of "from device" option in the Electric (Instant + Counter)" device, which would sort of make these two sensors equivalent?FireWizard wrote: ↑Thursday 17 August 2023 22:19 Hi @averter,
Sorry, that I did not understand your own naming of a virtual "Usage" sensor.
A virtual sensor of the type "Usage" will show you the actual usage in Watt and not the Consumed or Produced Energy.I have one dummy hardware device and have created a virtual sensor of the type "usage (electric)": this is what I mean by instantaneous electric virtual device. It works fine, but it doesn't include an energy counter in kWh, only the kW instantaneous reading
Therefore you need a sensor of the type: "Electric (Instant + Counter)". but you have to upload also the cumulative usage in Wh.
But, as far as I know, to replace an old sensor for a new one, both have to be of the same type. However this is not the case, so I cannot guarantee any success.
Regards
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
@averter,
You can try, but I never did that.
What @willemd said is correct, but he did not say, that you can replace two different type of sensors with each other.
Regards
You can try, but I never did that.
What @willemd said is correct, but he did not say, that you can replace two different type of sensors with each other.
Regards
-
- Posts: 621
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Indeed, I don't know about transferring data between sensors. I would look into the database see which tables are used for the various sensors, how the structure is and then use sqlite to do a transfer (after first making a backup). Not an easy answer. Maybe there are other options.
-
- Posts: 39
- Joined: Thursday 24 February 2022 8:32
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: Import Electric data to domoticz electric(instant+counter)
Yes, sqlite is probably my best bet. I'll give it a go after my next backup. Thanks both!willemd wrote: ↑Friday 18 August 2023 22:11 Indeed, I don't know about transferring data between sensors. I would look into the database see which tables are used for the various sensors, how the structure is and then use sqlite to do a transfer (after first making a backup). Not an easy answer. Maybe there are other options.
Who is online
Users browsing this forum: No registered users and 0 guests