40- How to Connect a Siemens LOGO to Home Assistant as an MQTT Sensor?

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 19

  • @21Aera
    @21Aera 5 месяцев назад +3

    Great content ! Thank you. It would be great to see also how to read a state from HA into the LOGO. For instance if a light is connected to the LOGO and we want to turn it on/off from HA.

    • @blociot
      @blociot  5 месяцев назад +1

      Thank your for your feedback. Great question. To control a light switch from HA, you need to define a SWITCH instead of SENSOR on the yaml file. you can find the details here:
      www.home-assistant.io/integrations/switch.mqtt/
      The only catch is the json payload format that needs to be defined under the SWITCH. Here is an example that you can use:
      {
      "state": {
      "reported": {
      "VM4": {
      "desc": "V-word-4-1",
      "value": [
      13
      ]
      }
      }
      }
      }
      This payload write the value of 13 to VM4 which is defined in LOGO MQTT transfer area.

    • @21Aera
      @21Aera 5 месяцев назад +1

      @@blociot Thank you! I'll try that when I have a chance to play with my lab 😁

  • @andlinux
    @andlinux 2 месяца назад +1

    I really need to buy new Logo's, I still have the 8.0 version from 8 years ago and they do not support MQTT or modbus tcp to communicate with the outside world (already asked people from Siemens on their forum) :)
    Lately started with Home Assistant/Zigbee/ESPHome and if I can add my Logo's to Home Assistant then I can control/automate almost everything from a central point.
    Thanks for the video's they are very informative.

    • @blociot
      @blociot  2 месяца назад +1

      Thanks for your feedback and time to watch this video. All be best with your cool projects. LOGO is a very interesting piece :)

  • @Ind4.0
    @Ind4.0 5 месяцев назад +1

    Seems my sprinkler system needs an upgrade 😅 Cool feature!

    • @blociot
      @blociot  5 месяцев назад

      @@Ind4.0 great application 👌

  • @arenetasatrec4939
    @arenetasatrec4939 4 месяца назад +2

    Nice. Did you managed to send signals from homeassistant or any type of platforms in to LOGO to act as inputs to do some actions with LOGO program such a trigger outputs or programme logics? If yes, in which video?

    • @blociot
      @blociot  4 месяца назад +3

      @@arenetasatrec4939 thanks for watching. I don't have a video for it but you're not the only person who asked for this feature so I will do a quick test and will record a short video for it in coming days.

  • @UniqueunlimitedBD
    @UniqueunlimitedBD 5 месяцев назад +1

    The RUclips channel video's SEO rating is poor of Due to this your subscribers and views are not increasing, and the titles, descriptions, and keywords SEO should be done correctly only then you will get good results. the same problem in Video every.

    • @blociot
      @blociot  4 месяца назад

      Thank you for the heads up. I just share videos to share knowledge. I'm not a professional content creator and don't know much about SEO on YT. But I should start working on it 👍

    • @UniqueunlimitedBD
      @UniqueunlimitedBD 4 месяца назад

      @@blociot Can I help you?

  • @DutchMovinghead
    @DutchMovinghead 4 месяца назад +1

    Nice vid! Also busy with Logo 8.4. Looking forward to the MQTT switch. Still trying here. In MQTT explorer i see the value is send, but the M1 stays 0.
    switch:
    # Siemens LOGO 8.4 network switches
    unique_id: xyz
    name: "xyz"
    state_topic: "LOGO_Pub" # Topic to read the current state
    value_template: '{{ value_json.state.reported.M1.value[0] }}'
    command_topic: "LOGO_Sub" # Topic to publish commands
    payload_on: '{"state": {"reported": {"V0": {"desc":"V-bit-0.0-1","value":[1]}}}}'
    payload_off: '{"state": {"reported": {"V0": {"desc":"V-bit-0.0-1,"value":[0]}}}}'
    state_on: "1"
    state_off: "0"

    • @blociot
      @blociot  4 месяца назад +1

      @@DutchMovinghead thanks for watching. I'll give it a try in coming days and will update you here.

    • @blociot
      @blociot  3 месяца назад +1

      Just uploaded a video for this topic. ruclips.net/video/RyjtpEOlTHQ/видео.htmlsi=FWPwwP7kPWoIseSl
      You may watch minute 10 to see the YAML file. I didn't include a state_topic for the MQTT switch. But it's the same idea. Hope this helps

    • @DutchMovinghead
      @DutchMovinghead 3 месяца назад +1

      @@blociot Heey! Thanks for the vid, tried the same. Good to mention that JSON hack, works indeed great! After a few tries i got it working as expected.

    • @blociot
      @blociot  3 месяца назад +1

      @@DutchMovinghead sounds great. Thanks for the update. Glad it's working.

  • @tjagusz
    @tjagusz Месяц назад +1

    I successfully connected my LOGO to HA using your video as a guide. Thank you! The sad part is that LOGO is sending each value in the same topic, which causes errors in logs, for example, if you have two inputs and you change the first one, then for second you will get an error: ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'I2' (value: {"state":{"reported":{"$logotime":1729768804}}}, template: {{ value_json['state']['reported']['I2']['value'][0] }}). Any ideas on how to solve this?

    • @blociot
      @blociot  Месяц назад +1

      Greta to hear the tutorial was useful.
      I didn't understand what do you mean by "when you change the first one...". Would you be able to explain more?
      If you want to access two analog inputs for example, first, you need to make sure the inputs are included in the transfer data area in the LOGO software. Once they are added, their value will be published to the topic as an JSON element. Here is an example, how you can access two analog inputs as two different MQTT sensors in HA:
      - name: LOGO Analog Input 1
      state_topic: "logo/pub"
      value_template: "{{ value_json['state']['reported']['AI1']['value'][0] }}"
      - name: LOGO Analog Input 2
      state_topic: "logo/pub"
      value_template: "{{ value_json['state']['reported']['AI2']['value'][0] }}"
      From the error message, it looks like I2 doesn't exists in your JSON payload that LOGO is publishing to your broker.