Mqtt_stream in include_dir_list or not? Yaml syntax?

HI
i would love to split up my mqtt_stream (MQTT Eventstream - Home Assistant) of anything that comes from the macadress of my Z-wave hub to polling the specific devices on that Hub. Ive connected my device successfully so thats not the issue. Also have the correct device d’s, see below

as it stand i poll everything by declaring
subscribe_topic: address/# in a mqtt_stream.yaml

and to be more specific and precise want to replace that by

subscribe_topic: address/energy-dsmr4/#
subscribe_topic: address/energy-solar-sdm630-modbus/f339a2fb/#
subscribe_topic: address/energymeter-sdm630-modbus/64904b93/#
subscribe_topic: address/sensormultilevel-zwave-CO2/#
subscribe_topic: address/sensormultilevel-zwave-airtemp/#
subscribe_topic: address/sensormultilevel-zwave-humidity/9e617f30/#
subscribe_topic: address/powerswitch-zwave/1e5c3646/#
etc
etc
etc

Ive made a directory mqttstreams and call that in my configuration.yaml by declaring

mqtt_eventstream: !include_dir_list mqttstreams for each of the separate subscribes, and named these files with the sensor name. contents:

subscribe_topic: address/energy-solar-sdm630-modbus/f339a2fb/#

This doesnt work as the !include_dir_list isn’t accepted, but i cant figure out how to declare all separate streams without getting the multiple instances error.

Cheers,
Marius

Event stream is for connecting 2 Home Assistant instances. Since your other hub isn’t a Home Assistant device, that component won’t work for you.

What you can do is define individual MQTT sensors using https://home-assistant.io/components/sensor.mqtt/ or one of the other MQTT components.

Bingo!
You’re right. Ive quickly managed to define several switches, and here they are! Cool, thanks very much!

Please let me ask a bit further now im making progress :wink:

below i paste the objects definition format of my Iungo device, which speaks for itself. The properties i want to be able to control and measure in HA are of course state On and Off, but also measured energy in Power and Usage.

I can’t seem to find these properties in a single Mqtt-Sensor or Mqtt-switch. Would in need to declare both a sensor and a switch for these PowerSwitches?

Thanks,
Marius

excerpt of Iungo object definition:

[
  {
     "driver": "powerswitch-zwave",
     "name": "4 - Espresso Keuken",
     "oid": "1e5c3646",
     "propsval": [
        {
           "id": "name",
           "value": "4 - Espresso Keuken"
        },
        {
           "id": "state",
           "value": "off"
        },
        {
           "id": "usage",
           "value": 0
        },
        {
           "id": "power",
           "value": 464.64
        },
        {
           "id": "classes",
           "value": "{0x00 }"
        },
        {
           "id": "hidden",
           "value": false
        },
        {
           "id": "enableset",
           "value": true
        },
        {
           "id": "available",
           "value": true
        }
     ],
     "propertyInfo": [
        {
           "type": "string",
           "label": "Name",
           "id": "name",
           "writable": true,
           "persistent": true
        },
        {
           "type": "command",
           "fn_set": null,
           "label": "Command",
           "id": "command",
           "writable": true,
           "range": "on,off",
           "timer": true
        },
        {
           "type": "boolean",
           "label": "associate",
           "id": "associate",
           "writable": true,
           "fn_set": null
        },
        {
           "type": "boolean",
           "label": "metering",
           "id": "associate3",
           "writable": true,
           "fn_set": null
        },
        {
           "type": "string",
           "default": "na",
           "label": "state",
           "id": "state",
           "writable": false
        },
        {
           "min": -4000,
           "type": "number",
           "label": "Power",
           "id": "usage",
           "max": 4000,
           "log": true,
           "unit": "Watt"
        },
        {
           "type": "number",
           "label": "usage",
           "id": "power",
           "log": true,
           "cumulative": true,
           "unit": "kWh"
        },
        {
           "type": "string",
           "label": "Classes",
           "id": "classes",
           "writable": false,
           "persistent": true
        },
        {
           "type": "command",
           "label": "meter reset",
           "id": "meterreset",
           "writable": true,
           "range": "reset",
           "fn_set": null
        },
        {
           "type": "command",
           "label": "meter get",
           "id": "meterget",
           "writable": true,
           "range": "usage,power,state",
           "fn_set": null
        },
        {
           "type": "boolean",
           "default": false,
           "label": "Hidden",
           "id": "hidden",
           "writable": true,
           "persistent": true
        },
        {
           "type": "boolean",
           "default": true,
           "label": "Enable set",
           "id": "enableset",
           "writable": true,
           "persistent": true,
           "fn_set": null
        },
        {
           "type": "boolean",
           "label": "Available",
           "id": "available",
           "writable": true,
           "fn_set": null
        }
     ]`Preformatted text`

Yeah, you’ll have to create separate entities for switch, power, and usage.

check, im at it.

Seems my Pi3 has a hard time computing all values… reboots take forever at the moment ;-((

Power and usage seem to go well. I have 2 separate entries for power and usage for each sensor now, i guess there;s some better way of coding that?

Will try defining switchable switches next, any special tips and tricks for that?

Cheers,
Marius

im trying to test some switches without any succes for now. I suspect it is the way these Mqtt switches are defined now.
Im not sure what to use, and consequently, what the correct syntax is.

This is what i have now:

- platform: mqtt
  state_topic: "macaddress/powerswitch-zwave/430ba8cf"
  name: "Office"
  command_topic: "macaddress/powerswitch-zwave/430ba8cf/command"
  availability_topic: "macaddress/powerswitch-zwave/430ba8cf/available"
  payload_on: "on"
  payload_off: "off"
#  optimistic: false
#  qos: 0
#  retain: true
  value_template: '{{ value_json.power }}'

Could you please help getting it right for me? Thanks for any help!
Marius

Below is the object declaration of my Zwave hub, Switch Office.

I want to be able to turn this in and off obviously , and lateron use it in automation scenes.
Best to prepare for that from the beginning:

here goes:

    {
         "driver": "powerswitch-zwave",
         "name": "6 - Office",
         "oid": "430ba8cf",
         "propsval": [
            {
               "id": "name",
               "value": "6 - Office"
            },
            {
               "id": "state",
               "value": "on"
            },
            {
               "id": "usage",
               "value": 6.4
            },
            {
               "id": "power",
               "value": 0.1668
            },
            {
               "id": "classes",
               "value": "{0x25 ,0x32 ,0x72 ,0x86 ,0x20 ,0x71 ,0x70 ,0x27 ,0x85 ,0x87 ,0x75 ,0x56 }"
            },
            {
               "id": "hidden",
               "value": false
            },
            {
               "id": "enableset",
               "value": true
            },
            {
               "id": "available",
               "value": true
            }
         ],
         "propertyInfo": [
            {
               "type": "string",
               "label": "Name",
               "id": "name",
               "writable": true,
               "persistent": true
            },
            {
               "type": "command",
               "fn_set": null,
               "label": "Command",
               "id": "command",
               "writable": true,
               "range": "on,off",
               "timer": true
            },
            {
               "type": "boolean",
               "label": "associate",
               "id": "associate",
               "writable": true,
               "fn_set": null
            },
            {
               "type": "boolean",
               "label": "metering",
               "id": "associate3",
               "writable": true,
               "fn_set": null
            },
            {
               "type": "string",
               "default": "na",
               "label": "state",
               "id": "state",
               "writable": false
            },
            {
               "min": -4000,
               "type": "number",
               "label": "Power",
               "id": "usage",
               "max": 4000,
               "log": true,
               "unit": "Watt"
            },
            {
               "type": "number",
               "label": "usage",
               "id": "power",
               "log": true,
               "cumulative": true,
               "unit": "kWh"
            },
            {
               "type": "string",
               "label": "Classes",
               "id": "classes",
               "writable": false,
               "persistent": true
            },
            {
               "type": "command",
               "label": "meter reset",
               "id": "meterreset",
               "writable": true,
               "range": "reset",
               "fn_set": null
            },
            {
               "type": "command",
               "label": "meter get",
               "id": "meterget",
               "writable": true,
               "range": "usage,power,state",
               "fn_set": null
            },
            {
               "type": "boolean",
               "default": false,
               "label": "Hidden",
               "id": "hidden",
               "writable": true,
               "persistent": true
            },
            {
               "type": "boolean",
               "default": true,
               "label": "Enable set",
               "id": "enableset",
               "writable": true,
               "persistent": true,
               "fn_set": null
            },
            {
               "type": "boolean",
               "label": "Available",
               "id": "available",
               "writable": true,
               "fn_set": null
            }

Can you run mosquitto_sub while you toggle the switch so you can get the topic name and payload?

mosquitto_sub -h <MQTT_IP> -p 1883 -u <MQTT_USERNAME> -P '<MQTT_PASSWORD>' -v -t '#'

ill try, but have to do from the ssh hassio prompt i guess?
Just learned that my wave hub only sends mqtt and doesn’t subscribe yet, so that would imply switching to be impossible. Maybe have to try api calls,

this does work, despite the error displayed:

58

Yes, you can run over ssh. If your hub doesn’t subscribe to any command topics, that might be a deal breaker to actually control the devices. There are the RESTful components that you could try if you want to go the api route.

check, found that indeed and will experiment.
Thanks for thinking along :+1: