thank you everyone for putting all of this together. I tried to implement this in my HA using Mosquitto and Appdemon and after a while I believe I got it generally working. At least the log of the Appdeamon start up is looking OK to me. One issue I am currently running into is that I get a script error for line 425:
[‘Scriptfehler - Fehler beim Holen und Auswerten der Gerätedaten in Zeile: 425’, TypeError(‘keys must be str, int, float, bool or None, not AppDaemon’)]
Any idea where this could come from and how to fix it?
Thanks,
Flo
Log file of Appdemon during startup:
Letzte Fehler-ID: 230837
Verbunden mit MQTT Broker...
Topics wurden abonniert...
Wasserverbrauch gestern: 0
Offset für heutigen Wasserverbrauch: 202775
Letzte Ausführung des Scripts: 22
da: XXX
dt: XXXX
serial: XXXXX
token: XXXXXXXXXXXXXXXX
Initialisierung erfolgreich!
2023-02-22 12:48:45.649182 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/main/config_getjudo_default.py - ignoring
2023-02-22 12:48:45.690110 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/main/messages_getjudo.py - ignoring
2023-02-22 12:48:45.695716 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
Autoconfigs wurden gesendet...
2023-02-22 12:48:45.710602 INFO AppDaemon: Initializing app main_app using class main_loop from module main_entity
2023-02-22 12:48:45.729951 INFO AppDaemon: Initializing app judo_app using class entity from module getjudo
2023-02-22 12:48:45.977588 INFO hello_world: Hello from AppDaemon
2023-02-22 12:48:45.979819 INFO hello_world: You are now ready to run Apps!
2023-02-22 12:48:45.985474 WARNING AppDaemon: Unable to find initialize() function in module judo_app - skipped
2023-02-22 12:48:45.986787 INFO AppDaemon: App initialization complete
['Scriptfehler - Fehler beim Holen und Auswerten der Gerätedaten in Zeile: 425', TypeError('keys must be str, int, float, bool or None, not AppDaemon')]
You have to setup and define your config, then rename from “config_getjudo_default” to “config_getjudo”
Did you modified the apps.yaml file or any other file? because I believe it runs the script twice:
2023-02-22 12:48:45.729951 INFO AppDaemon: Initializing app judo_app using class entity from module getjudo
Config was defined correctly and config was named correctly already.
Thanks for the hint with running the script twice. This was the case and I could resolve the issues with running it just once once.
What I learnt is that running the script as
main_app:
module: main_entity
class: main_loop
works for me. Nevertheless, running the scrips as
judo_app:
module: getjudo
class: entity
runs into the script error posted before: [‘Scriptfehler - Fehler beim Holen und Auswerten der Gerätedaten in Zeile: 425’, TypeError(‘keys must be str, int, float, bool or None, not AppDaemon’)]
Just posting this finding here in case someone else is running into this issue as well in the future.
Thanks for your support!
@www-ShapeLabs-de
Thank you for bringing Judo to my HA Installation!
All ist up and running and i can track my water consumption etc… (ok, right now my Judo itself is offline - have to fix this asap).
One question regarding the entitities:
To use eg the water entity in the HA energy dashboard it needs some extra information (i think so - i*m really new to HA).
Now it is:
unit_of_measurement: m³
icon: mdi:water-circle
friendly_name: Judo_isoftsaveplus-home Gesamtwasserverbrauch
Nice would be:
unit_of_measurement: m³
device_class: water
icon: mdi:water
friendly_name: Wasserverbrauch
state_class: total_increasing
Seems hard for a noob like me to fix this. Creating a template sensor in configuration.yaml with state_class: total increasing ist not accepted bei HA.
Any chance to implement this directly in the code for Judo?
Thanks
Edit:
HA does not accept a new sensor with state_class: total_increasing, but a template seem to work:
But on Feb. 10th I had an HDD Crash at my Computer and it took my a few Weeks to recover most of the things, and so the topic of getting my JUDO talking to Homeassistant was not that urgent.
UPDATE:
The last problem I had could was a result of wrong MQTT credentials I`ve entered into your config file.
Now your Script is doing well and I also get the Entities inside Homeassistant for about 2 hours.
Just one more question about the Entities:
Getting an 0 for Batterierestkappa, Salzreichweite and Wasserdurchflussmenge is OK as there`s no Sensor for that.
Gesamtwasserverbrauch, Verbrauch_Gestern and Verbrauch_Heute is also 0.
Can you tell me how long does it take for the Waterconsumption values to be published.?
The Gesamthartwasseranteil is declared to be negative -143,631 m³
the Gesamthartwasseranteil is negative because it is very likely calculated as (Gesamtwasserverbrauch - Gesamtweichwasseranteil). SInce your Gesamtwasserverbrauch = 0 you get a negative value. See screenshot. Hope that helps a little.
your dataset looks normal so far, but unfortunately the attachment under index 8 returns the value 0
8:{“data”: “00000000”
st: “OK”
er:""}
This should actually be your total water consumption in hexadecimal coding. I searched the myjudo javascript again to see if there is another index where the total water hardness is coded, but unfortunately found nothing:
Hey Gohakn,
I noticed that the display of the totalwater amount in the app/browser is very similar with the softwater amount from the script. Is it maybe the same value and you have used another 3.7m³ in the meantime, or do you have very hard water? The statistics query (chart) is a different HTTP command. I had also executed this via my script in the meantime. The problem was that the Judo server had blocked the token if this command was executed in too short time intervals. Therefore the daily consumption is calculated by the script itself from the difference of the current total water quantity to that of 0.00o’clock.
Maybe you note the value of your water meter and the value from the script, wait a few days and then compare the difference of the values. If this is the same, then it could be that the value of the soft water quantity at the Softwell is the total water quantity.
Here you can see how the Menu looks like and which Values are given inside the Webpage.
So for me your:
“Gesamtweichwasser Anteil” is the Total Consumption and should be the “Gesamtwasserverbrauch”
“Gesamthartwasser Anteil”, “Batterierestkapazität” and “Salzreichweite” are unneccesary because it`s not measured / monitored
“Verbrauch Gestern und Verbrauch heute” should be calculated from the “Wasserverbrauchsdiagramm” 0:00 to 24:00 Uhr / day
As I`ve never done programming & coding something like your Judo Integration I have no plan how much time it would take to make these three changes and this only if one is using a Softwell P, because otherwise everything works perfect right as it is.
Can you make a forecast how much there is to do?¿?
this is all done relatively fast, if you know the code of the script and where to start. Since I wrote the code, this would be maybe a quarter of an hour’s work for me.
If you give me a little time, I would adjust everything on occasion so that you can set in the config file if you want to use the script with the Softwell system. Then we would have a version that can be used for both systems.
Hello Henning, (@www-ShapeLabs-de ),
I’ll jump on what @Sesshoumaru wrote: Do you think this would work with the ZEWA i-SAFE? Due to stupid reasons, I won’t be able to get the i-soft, so for leakage protection etc. the ZEWA i-SAFE is my only choice.
Also: Judo advertises local API access… has anybody found any link into that? Because running this script seems overly difficult, if really there should be local API integration. No?