Closed swejmansson closed 2 years ago
Data must be String when using Custom Sensor, as I do. https://www.domoticz.com/wiki/Developing_a_Python_plugin#Devices I have tried to use other SubTypes but then i could not push data to InfluxDB. I will try again and see if I made a mistake last time.
http://IP:PORT/json.htm?type=devices&rid=xxxxxxx
If you change IP, PORT and xxx to your settings, what do you see for SPA device? result -> Data
Here you go....
{ "ActTime" : 1634667495, "AstrTwilightEnd" : "19:55", "AstrTwilightStart" : "05:37", "CivTwilightEnd" : "18:29", "CivTwilightStart" : "07:04", "DayLength" : "10:09", "NautTwilightEnd" : "19:12", "NautTwilightStart" : "06:20", "ServerTime" : "2021-10-19 20:18:15", "SunAtSouth" : "12:46", "Sunrise" : "07:42", "Sunset" : "17:51", "app_version" : "2021.1", "result" : [ { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CounterToday" : "4.906 kWh", "CustomImage" : 0, "Data" : "8.630 kWh", "Description" : "", "EnergyMeterMode" : "0", "Favorite" : 0, "HardwareDisabled" : false, "HardwareID" : 9, "HardwareName" : "Shelly MQTT", "HardwareType" : "Shelly MQTT", "HardwareTypeVal" : 94, "HaveTimeout" : false, "ID" : "shelly1pm-F4CFA2E383F4-0-energy", "LastUpdate" : "2021-10-19 20:18:10", "Name" : "SPA, Effekt", "Notifications" : "false", "PlanID" : "4", "PlanIDs" : [ 4 ], "Protected" : false, "ShowNotifications" : true, "SignalLevel" : "-", "SubType" : "kWh", "SwitchTypeVal" : 0, "Timers" : "false", "Type" : "General", "TypeImg" : "current", "Unit" : 41, "Usage" : "2.26 Watt", "Used" : 1, "XOffset" : "729", "YOffset" : "430", "idx" : "218" } ], "status" : "OK", "title" : "Devices" }
Thanks. As you can see it also have kWh. I think HomeHabit remove "kWh" when they import the data. "Data" : "8.630 kWh" I will try to find a way to set more correct SubType and then I guess it will be correct in HomeHabit as well
Let me know if you want me to verrify ๐
Iยดm using HomeHabit app on android tablets to represent data from Domoticz. For some reason it is not possible to vizualise the tibber sensor values with gauges. Are the values in the sensors stored as strings? When I show them with the value-tool in HomeHabit it writes out the value with unit, like "2234 w". Must be a string ๐ค If it is strings, are you planning to correct it and store as number/flowt? The way around it for me can be to mask/convert them to fit my use case, but it would be better to do it "correct" from the beginning. Most likely some more users can bump into issues when they want to use/display the values ๐