Comments (10)
(grrr GH closed the Pull-Request and I cant reopen it) so here again, to @pepijng :
- About units
We need to make this "Water proof". I mean , that we have to always parse the correct value and store it as a valid float, whatever the language used. (The template already take care to reformat it according to the user defined locale). So what I dont understand, is why you get for example "CounterToday" : "15.000 kWh""
If I follow you, this must be (float) 150000.0 KW, right? SO why the fuck is Domoticz return it as this?
Is "." the Dutch way to format thousands? And addionnally, are there any decimals possibly displayed?
I mean:
in US format I would display:
15,000.5 KWH = (float) 15000.5
In french I would display
15 000,5 KWH = (float) 15000.5
In Dutch
15.000(?)5 KWH = (float) 15000.5 ?????????????
Yes?
So Domoticz returns a localised value in the API (absolutely dumb!) ?
- about your second question, Checkout the develop branch : The dashboard should already display the Device unit.
from phpmydomo.
BTW : there are 2 words still needing a NL translation!
from phpmydomo.
I will update the translation. See the attached output from Domoticz and PMD
There still is a decimal issue, the "." is used for decimals not for separating the thousands.
from phpmydomo.
Please answer my previous question about unit, if you can.
Else, please provide me the corresponding dump of this sensors (uncomment the $this->debug(devices) in the api_client), to help me to understand how units are handled in the API.
We need to fix this decimal/thousand issue before releasng the next version. ;-)
from phpmydomo.
[sensor_counter_2_today] => Array
(
[address] => 2
[name] => Gasmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 3378.367
[CounterToday] => 5.473 m3
[CustomImage] => 0
[Data] => 3378367
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Gasmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Gas
[SwitchTypeVal] => 1
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 2
[Used] => 1
[idx] => 2
)
[class] => sensor
[type] => counter
[value] => 5473.3
[unit] => m3
[uid] => sensor_counter_2_today
[img_type] => counter
)
[sensor_consum_2_now] => Array
(
[address] => 2
[name] => Gasmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 3378.367
[CounterToday] => 5.473 m3
[CustomImage] => 0
[Data] => 3378367
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Gasmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Gas
[SwitchTypeVal] => 1
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 2
[Used] => 1
[idx] => 2
)
[class] => sensor
[type] => consum
[value] => 0
[unit] => m3
[uid] => sensor_consum_2_now
[img_type] => consum
)
[sensor_counter_2] => Array
(
[address] => 2
[name] => Gasmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 3378.367
[CounterToday] => 5.473 m3
[CustomImage] => 0
[Data] => 3378367
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Gasmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Gas
[SwitchTypeVal] => 1
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 2
[Used] => 1
[idx] => 2
)
[class] => sensor
[type] => counter
[value] => 3378.367
[unit] => m3
[uid] => sensor_counter_2
[img_type] => counter
)
[sensor_counter_1_today] => Array
(
[address] => 1
[name] => Electriciteitsmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 14416.000
[CounterDeliv] => 0.000
[CounterDelivToday] => 0.000 kWh
[CounterToday] => 13.000 kWh
[CustomImage] => 0
[Data] => 8572000;5844000;0;0;1100;0
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Electriciteitsmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Energy
[SwitchTypeVal] => 0
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 1
[Usage] => 1100 Watt
[UsageDeliv] => 0 Watt
[Used] => 1
[idx] => 1
)
[class] => sensor
[type] => counter
[value] => 13000
[unit] => kWh
[uid] => sensor_counter_1_today
[img_type] => counter
)
[sensor_consum_1_now] => Array
(
[address] => 1
[name] => Electriciteitsmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 14416.000
[CounterDeliv] => 0.000
[CounterDelivToday] => 0.000 kWh
[CounterToday] => 13.000 kWh
[CustomImage] => 0
[Data] => 8572000;5844000;0;0;1100;0
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Electriciteitsmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Energy
[SwitchTypeVal] => 0
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 1
[Usage] => 1100 Watt
[UsageDeliv] => 0 Watt
[Used] => 1
[idx] => 1
)
[class] => sensor
[type] => consum
[value] => 1100
[unit] => W
[uid] => sensor_consum_1_now
[img_type] => consum
)
[sensor_counter_1] => Array
(
[address] => 1
[name] => Electriciteitsmeter
[battery_level] => 255
[signal_level] => 12
[raw] => Array
(
[BatteryLevel] => 255
[Counter] => 14416.000
[CounterDeliv] => 0.000
[CounterDelivToday] => 0.000 kWh
[CounterToday] => 13.000 kWh
[CustomImage] => 0
[Data] => 8572000;5844000;0;0;1100;0
[Favorite] => 1
[HardwareID] => 1
[HardwareName] => P1 Smart Meter
[HaveTimeout] =>
[ID] => 1
[LastUpdate] => 2013-12-16 22:50:21
[Name] => Electriciteitsmeter
[Notifications] => false
[SignalLevel] => 12
[SubType] => Energy
[SwitchTypeVal] => 0
[Timers] => false
[Type] => P1 Smart Meter
[TypeImg] => counter
[Unit] => 1
[Usage] => 1100 Watt
[UsageDeliv] => 0 Watt
[Used] => 1
[idx] => 1
)
[class] => sensor
[type] => counter
[value] => 14416
[unit] => kWh
[uid] => sensor_counter_1
[img_type] => counter
)
from phpmydomo.
The Dutch format uses a . as separator for thousands and , as separator for the decimals. But this is not what the Domoticz API produces.
[Counter] => 14416.000 = 14.416,000 kWH (dutch), 14,416.000 (US)
Translation:
$lang['types']['consum'] ="Verbuik";
$lang['types']['counter'] ="Meter";
from phpmydomo.
ok so :
-
- 'Counter' is a valid float with 3 decimals (14400.000 = 14,416.000 US = 14.416,000 kWH dutch )
-
- 'Usage' is an integer with units (1100 Watt = 1,100 US = 1.100 dutch). Can you make sure there are NEVER decimals, ie 1100.5 ?
-
- 'Usage' does not apply to Gas, only to Energy ?
-
- 'CounterToday' is a float with units (5.473 m3 = 5.473 US = 5,473 dutch)
Please confirm each point.
from phpmydomo.
Latest develop branch fixed this assuming YES to the 4 previous questions.Check it out and confirm all points, please.
Thank you 4 your Help! ;-)
from phpmydomo.
- Yes
- Yes
- Yes
- Yes
So it looks great for me!
from phpmydomo.
Great, THANK YOU.
We're going to release 0.134. ;-)
BTW if you have dimmers, would you please answer #1 : I'm waiting for feedback on this before releasing v0.134.
from phpmydomo.
Related Issues (20)
- Ugly fonts HOT 12
- Clone git HOT 2
- Installation HOT 1
- domotiga can only swich on HOT 2
- Domotiga Temperature value (commas vs Dots) HOT 14
- Get a warning message ? HOT 7
- Invalid dimmer command send to DomotiGa backend server HOT 3
- Dimmer values not correctly retrieved from DomotiGa backend HOT 5
- pilight <-- lowercase HOT 1
- Units for "consum" sensors missing in header of groups HOT 2
- Installation HOT 1
- How to remote access through internet ? HOT 1
- Support for wind direction sensors
- Problem with home folder HOT 4
- does not work over https HOT 5
- Location name too long HOT 1
- Italian translation HOT 2
- Italian translation HOT 1
- Adding Tellstick API client
- pictures are missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmydomo.