Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add devices Alert/Pump, UOMs #755

Merged
merged 5 commits into from
Nov 20, 2022
Merged

add devices Alert/Pump, UOMs #755

merged 5 commits into from
Nov 20, 2022

Conversation

MichaelDvP
Copy link
Contributor

For #575 and #720 there are now extra devices without entitiies, check if you are ok with the icons.

I've changed some uoms to utf-8 characters (µA, m², m³), api/mqtt works ok for me, but check if HA accepts it.

Also for #752 i've added the possibe translation of times (seconds/minutes/hours), but commented out, please first check if it is ok with HA. (emsdevice.cpp, line 59)

@proddy
Copy link
Contributor

proddy commented Nov 19, 2022

ok, will check on HA

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

@MichaelDvP
I tested translations of times with my km200 node-red part for ha where I use mqtt discovery for the ha-entities as well.
No problem at all to change "mins" (from km200) to "Minuten" and "hours" to "Stunden".

What shall I do to test for ems-esp?

@MichaelDvP
Copy link
Contributor Author

@tp1de checkout this PR or dev from my repo, remove the comment marks emsdevices.cpp line 59/69, compile.
Create 3 analog sensors with uom µA, m², m³. (e.g. gpio34/35/36, type ADC) if you dont have entities with these uoms (µA- flame current, m² solar area, m³, ?). Check HA and API for uoms, change language of entities and check uoms of times (minutes/hours/seconds).

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

@MichaelDvP I compiled. Translations of times are working (German).
I created 3 sensors:
image

uom m³ does not work for api / ha. The other 2 are fine for English / German:

{
"Analog Sensor GPIO34": {
"gpio": 34,
"type": "number",
"analog": "adc",
"uom": "µA",
"offset": 0,
"factor": 1,
"value": 78
},
"Analog Sensor GPIO35": {
"gpio": 35,
"type": "number",
"analog": "adc",
"uom": "m²",
"offset": 0,
"factor": 1,
"value": 78
},
"Analog Sensor GPIO36": {
"gpio": 36,
"type": "number",
"analog": "adc",
"uom": "",
"offset": 0,
"factor": 1,
"value": 78
}
}

@MichaelDvP
Copy link
Contributor Author

Not a charset issue, just the reference to the strings for cubicmeters and liters were missing.

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

Yes works now.

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

I just have seen that for sensor type counter the factor can't be 0.01. It might be used for gas consumption - my meter gives an impulse every 0.01 m3. I do not need it since I use a Raspberry Pi for this but it might be of general interest ....

@MichaelDvP
Copy link
Contributor Author

grafik

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

hmmmm
When I enter 0,0 the display is resettet to 0. when I enter 0,1 the I can change it to 0,001

@MichaelDvP
Copy link
Contributor Author

This depends on browser, firefox accepts input 0,01, edge likes to round to step value of 0,1 on input, then you could edit inserting zeros.
BTW: I tested with your iobroker-adapter, analog and dallas does not read the uom. Boiler/flamescurr shows correctly: µA
In webbrowser (firefox) a analogsensor value shows up as:

ems-esp.local/api/analogsensor/test

response-header:
Accept-Ranges: none
Connection: close
Content-Length: 156
Content-Type: application/json; charset=utf-8
body:
{
  "gpio": 38,
  "name": "test",
  "type": "number",
  "analog": "counter",
  "uom": "m³",
  "offset": 0.01,
  "factor": 0.001,
  "value": 0.01
}

Has anybody yet tested HA? Sensorconfig looks ok to me:

{
  "~": "ems",
  "uniq_id": "boiler_flamecurr",
  "stat_t": "~/boiler_data",
  "name": "Flammenstrom",
  "object_id": "boiler_flame current",
  "val_tpl": "{{value_json.flamecurr}}",
  "unit_of_meas": "µA",
  "ic": "mdi:lightning-bolt-circle",
  "state_class": "measurement",
  "dev": {
    "ids": [
      "ems-esp-boiler"
    ]
  }
}

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

Has anybody yet tested HA? Sensorconfig looks ok to me:

HA looks ok for me
image

BTW: I tested with your iobroker-adapter, analog and dallas does not read the uom. Boiler/flamescurr shows correctly: µA

Thanks for info ... I never tested analog sensors within ioBroker. I have'nt had a look at the code for some months now. I will check. I am on the way to move to ha.

@proddy
Copy link
Contributor

proddy commented Nov 19, 2022

I'm planning to test HA tonight

@proddy
Copy link
Contributor

proddy commented Nov 19, 2022

@MichaelDvP #752 - the translations of UOM seem to work fine in HA, so I would say un-comment the lines at #59 and merge this PR

image

@tp1de
Copy link
Contributor

tp1de commented Nov 19, 2022

@MichaelDvP if you want you can check latest ioBroker adapter version by installing from GH. UOM's should work now for Sensors as well.

@MichaelDvP
Copy link
Contributor Author

@proddy Ok, i've also changed the lot of if to switch.
@tp1de Analog have uoms now, dallas not, also iobroker warns about missing type for dallas. But this is mainly caused by analog/dallas info commands, which are inconsitent to info/value commands for ems-devices. I'll make a new GH issue for that (tomorrow). We should change in ems-esp first, than you could adapt. Further discussions to the new GH issue.

@tp1de
Copy link
Contributor

tp1de commented Nov 20, 2022

@proddy
I recognized that while changing names for sensors (analog & dallas) within web-ui the entity id changes as well for HA.
I think only full name should change - or ?

#758

@proddy
Copy link
Contributor

proddy commented Nov 28, 2022

Michael fixed it and I confirm it works in HA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants