IUNGO Forum
Het Forum is voor IUNGO gebruikers en wordt ook vooral beantwoord door andere IUNGO gebruikers.
IUNGO maakt zelf beperkt gebruik van het Forum.
Specifieke vragen of storingen dus graag melden via de mail naar ons info adres.
Het Forum is voor IUNGO gebruikers en wordt ook vooral beantwoord door andere IUNGO gebruikers.
IUNGO maakt zelf beperkt gebruik van het Forum.
Specifieke vragen of storingen dus graag melden via de mail naar ons info adres.
EDIT: 15/01/2023
Code gedeeld en informatie gestroomlijnd. Feedback is welkom
De basis vind je hier:
https://www.iungo.nl/nl/forum/alternatieve-aansturing/167-mqtt?start=60#842
En
https://www.iungo.nl/nl/forum/alternatieve-aansturing/167-mqtt?start=0#2813
En
https://www.iungo.nl/nl/forum/alternatieve-aansturing/167-mqtt?start=0#2816
Ik heb ondertussen de mqtt topics werkend voor sensoren, (binary) switches.
Ook de shell comands en template switches werken. Het heeft me veel leeswerk en gepuzzel gekost switchend tussen dit forum en dat van Home Assistant om de diverse code snippets bij elkaar te krijgen (met dank aan de input van @Rodney en @Marijn.
Hieronder vind je mijn (ge-anonimiseerde) configuration.yaml hieronder geplakt als referentie voor wie er mee aan de slag wil;
Ik zal de code de komende tijd updaten met kleine stappen (bijvoorbeeld om sensoren zichtbaar te maken op het energie dashboard van Home Assitant.
Let bij het gebruiken van onderstaande code op het aanpassen van:
- je IUNGO IP adres
- je IUNGO MAC adres
- gebruik van de juiste OID’s (object identifyers) uit je IUNGO
# Home Assistant 2023.1.4 # Supervisor 2022.12.1 # Operating System 9.4 # Frontend-versie: 20230110.0 - latest configuratie.yaml volgt # mqtt configuration # mqtt sensors mqtt: sensor: - name: iungo solar state_topic: '70:BB:33:EE:FF:22/energy-solar-sdm220-modbus/xxxxxxx/solar' unique_id: sensor_iungo_solar unit_of_measurement: Watt # mqtt switches binary_sensor: - name: plintboiler unique_id: iungo_plintboiler state_topic: '70:BB:33:EE:FF:22/powerswitch-plugwiserf/xxxxxxx/state' payload_on: 'on' payload_off: 'off' # mqtt iungo shell commands shell_command: update_iungo_hub: >- curl -X POST -d '{"seq":1,"method":"fw_update"}' http://192.168.1.1/iungo/api_request plintboiler_on: >- curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"xxxxxxx", "prop":"command", "value":"on"}}' http://192.168.1.1/iungo/api_request plintboiler_off: >- curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"xxxxxxxx", "prop":"command", "value":"off"}}' http://192.168.1.1/iungo/api_request # mqtt template switch switch: - platform: template switches: plintboiler: friendly_name: Switch Plintboiler value_template: "{{is_state('binary_sensor.plintboiler','on')}}" turn_on: service: shell_command.plintboiler_on turn_off: service: shell_command.plintboiler_off
Wellicht helpt dit overzicht mensen de stap te maken.
Wellicht goed om te weten dat, mocht je met de configuration.yaml aan de slag willen,, dat dit bestand erg gevoelig is voor foutjes.
gebruik dan ook een goede editor zoals bv visual studio code
https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863
Dat helpt enorm bij het bouwen van een goede syntax en geeft bijvoorbeeld ondersteuning bij tik en spatie fouten.
En last but not least, doe alles in stapjes. Zorg eerst dat je ziet dat de mqtt stroom werkt, maak dan een werkende sensor in HA, bouw dan de shell commands en als die werken… enz enz
Als iemand vragen heeft, stel ze gerust.