How to send Float values to Domoticz instead of Integers ?
Posted: Saturday 10 February 2018 14:24
I'm coding an SDM630 smart meter plugin for energy usage and return for Domoticz at the moment. See attached screenshot.
It is working fine, except that i can only update Integer values instead of Floats.
For updating I use this piece of code.
Code snippet:
row = line.split('\t')
# Watts 1
s="%.1d; %d" % (float(row[7]), 0)
Devices[7].Update(nValue=int(float(row[7])), sValue=s)
'row' contains the fields of a TAB separated ASCII output record from the SDM630 meter.
I have 2 questions:
- I tried sending nValue=float(row[7]). That gives me a type error. How do I update a float value using a float ?
- How do I set the SubTypeName of the Current meter ? I used TypeName 'Current/Ampere'. It currently shows up as a 'CM113/ElectriSave', which I don't have.
Ps. Forgive me my high energy usage
At the moment we're heating our Swedish house directly on electricity using a 2 phase heater. Here in Sweden one pays alot extra to the electricity network company if you're a netto producer over the year. So we have to burn our 500kWh PV overproduction of last summer
Using roughly 60kWh a day it will be done in about 8 days
It is working fine, except that i can only update Integer values instead of Floats.
For updating I use this piece of code.
Code snippet:
row = line.split('\t')
# Watts 1
s="%.1d; %d" % (float(row[7]), 0)
Devices[7].Update(nValue=int(float(row[7])), sValue=s)
'row' contains the fields of a TAB separated ASCII output record from the SDM630 meter.
I have 2 questions:
- I tried sending nValue=float(row[7]). That gives me a type error. How do I update a float value using a float ?
- How do I set the SubTypeName of the Current meter ? I used TypeName 'Current/Ampere'. It currently shows up as a 'CM113/ElectriSave', which I don't have.
Ps. Forgive me my high energy usage


