Connect third party sender (Iungo) to Hassio - Mosquitto

HI,

After an intense struggle ( :wink: ) i’ve finally managed to setup the Hassio configuration with secure communication, and Mosquitto is running fine. That is, i think it is, since i can connect the Owntracks app.

My home energy system is setup through a Z-wave Hub that reads ( and displays its own interface) all connected switches, Environmental meters, Solarpanels, Gas meter, Smart meter, Modbusses, etc etc.

http://Iungo.nl to find more info. https://www.iungo.nl/nl/forum/alternatieve-aansturing/167-mqtt for the specifics on their mqtt setup

Recently the developers have made the above mqtt connection available. Of course i want to connect the Iungo setup with the Home Assistant.

I have no clue where to start though…

Please send me on my way for making the connection between the 2 systems, which are both successfully connected to the Mosquitto service.

Ive included the Hubs output log into Mqtt, so prove whats the result, and give you an idea of the dataflow.

Thanks a lot,
Marius

HI Marius,

Did you ever get sorted with iungo and home assistant?

greets 330

Sure! Been running fine ever since;-)

What do you want to know?

Well, I’d like to know what u are now using as interface to monitor the energy in and out. I’d like to know if you can use the z-wave from the iungo to control other devises in the smart home environment and last but not least how to setup the iungo and the mqtt broker. Where i have to say the iungo api is already setup to HA.

Oh and quite new :wink:

it really is very easy:

  • install the Mosquito broker in your HA instance via Supervisor.
  • enter the IP address of that broker (ha instance) and credentials in the Iungo control page

check the mqtt add-on logs for correct connection

then, setup mqtt integration via configuration/integrations, click the + and search for MQTT, enter the same credentials.

Your HA instance should now be able to create Mqtt sensors,dependingon the hardware you have connected to the Iungo.

for the topics, you can best use an app like Mqtt explorer to get the exact topic path.

and yes, you can switch the wave switches, but not using the Z-wave integration in HA. Either subscribe to the topics Iungo sends to the broker, (and read these topics as mqtt sensors)

  - platform: mqtt
    state_topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/1234567/usage'
    name: Audio Auditorium actueel
    unit_of_measurement: Watt

or send commands to the Iungo via the Iungo api using shell_commands.

shell_command:

  audio_auditorium_on: >
    curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"1234567", "prop":"command", "value":"on"}}' http://192.168.1.27/iungo/api_request

Iungo hasnt opened its mqtt command, so won’t accept these.

Might sound more complicated than it really is, so take in step by step, and you’ll get there shortly

Thanks Marius,
It indeed looks a bit confusing, especially as a digibeet :wink: But i’ll give it a try.

greets Chauf

yeah, well take it step by step :wink:

you know where to find the control page in Iungo?

http://192.168.1.xxx/iungo/control? (including the ?, of course, adapt ip accordingly)

and then scroll to the bus-mqtt

dont select filter enable (yet) to have the Iungo publish all events

Note the IP address in the Broker address, this is the IP address of the HA instance you run the integration Add-on on, described in the post above under the first bullet

thanks alot,

I’ll try to sort that out when I can. I did notice that I had the filter on in the iungo and I am not quite sure how to configure or what to fill in on the MQTT side of this communication but I’ll mess around with that a little over the coming days.

dont select it, so the Iungo publishes all topics to the MQTT broker. Thats all you need to setup at Iungo :wink:

ok so no touching the Z-wave to MQTT gateway?

Hi Marius,

Thanks for your help so far. I got the usage info from the Z-wave switches on visible in HA. However switching them on and off from within HA is a bit advanced for me at this stage. Any chance for a bit of step by step help on that?

sure np.

the Iungo only accepts external api calls which you can enter in a terminal app using a curl command, or, of course using th shell_command I posted above

shell_command:

  audio_auditorium_on: >
    curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"1234567", "prop":"command", "value":"on"}}' http://192.168.1.27/iungo/api_request

you do need to find the object id (oid) of the switches, and they are available to you in the Iungo control interface between the square brackets [123456]

with that oid and the adapted IP address in the resource you can build the curl command.

enter that in the terminal and hit enter to see what happens :wink:

in terminal that returns a:

URL using bad/illegal format or missing URL

I copied and pasted your link changed the IP address of my iungo and the oid to the switch i’d like to turn on.

I did the same with the link that you posted a little further up and put that in the conf.yaml file. when then checking the configuration HA returns the following.

Invalid config for [shell_command]: invalid slug Licht_keuken_on (try licht_keuken_on) for dictionary value @ data[‘shell_command’]. Got OrderedDict([(‘Licht_keuken_on’, ‘curl -X POST -d ‘{“seq”:1, “method”:“object_prop_set”, “arguments”:{“oid”:“25b1fa26”, “prop”:“command”, “value”:“on”}}’ http://192.168.1…/iungo/api_request’)]). (See /config/configuration.yaml, line 113).

i’m like totally laughing at myself now :wink:

please post here, and in correct code block, or we cant see what you did exactly (use the 3 backticks before and after the code ) or select the code and click the </> button in the editor menu

as for the slugs, the error returns the solution: use lower case only

shell_command:

  licht_keuken_on: >
    curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"25b1fa26", "prop":"command", "value":"on"}}' http://192.168.1..../iungo/api_request

yes, that should do it.
if you take only the curl line, and copy that into the terminal, it should switch on, and return useful succes/error information

btw not need to cover the IP address, its internal, so of no use for anyone outside your config…

That is amazing.
I’ll paste that into the config.yaml and see what it returns then

yes, that will work, and, after having created these shell commands for ‘on’, ‘off’, you can create a template switch to handle these more easily:

      test_library:
        friendly_name: Test Library
        value_template: >
          {{is_state('sensor.test_library_state','on')}}
        turn_on:
          service: shell_command.test_library_on
        turn_off:
          service: shell_command.test_library_off

you could also use an mqtt binary_sensor for the state:

binary_sensor:
  - platform: mqtt
    name: Test Library
    state_topic: 'macaddress-iungo/powerswitch-zwave/oid/state'
    payload_on: 'on'
    payload_off: 'off'

It seems that when I copy lines, for instance the early line you had posted and then change the ip address / oid an other pertinent info that sometimes that doesn’t work. Then if I type the same thing letter for letter it does work. little odd if you ask me. I’ve noticed that in copying other lines as well.

Anyway I have added it to my config.yaml which at this point doesnt return any errors the next step I guess would be to create a switch for the lovelace interface

I just saw your answer

that is probably because copying from this community forum uses the incorrect quotes.