Siemens logo 8

Hi Steve,

for the communication between HomeAssistant and your Siemens Logo, I would personally prefer NodeRed as “middleware”.
If you run HomeAssistant with supervisor, you can search for the NodeRed Addon - and install it.

NodeRed is a Java based flow editor, which does nicely integrate into HomeAssistant - and there are integrations for nearly everything available in NodeRed.

Even an Integration to talk with your Simenes Logo.

Here’s a description on how to install the Siemens Logo Contribution into NodeRed:
https://flows.nodered.org/flow/272a6d2104474c68f7b0e01bae025ead

There, you should also find an explanation what you need to configure in your Logo to communicate with it.

With this integration, I have managed to build a “simple” Monitoring system for two terrariums, that will be controlled with the Logo (before I’ve started with HomeAssistant…)

To send commands to your Logo, you need to use NI blocks (Network Input)… you can’t directly trigger I Blocks (Logo-Input) nor controll Output (Q) blocks directly.

Hallo Christoph,
big thanks for your Reply. I will have a look on the NodeRed thing.
So basically i have to change the Logo programming for the Shutters. I will try to find out if i can just change the I Block with the NI Block in the programming.

I would not change the I block with the NI block.
You could use the I block together with an NI block and combine them with an OR block.

that would allow you, to use the Logo internal Input OR the Network Input.

Ahhh ok i understand. I will try the NI Block with just 1 Shutter and see if it works.
I will try to get a connection via node-red → Logo on the weekend.
Thanks for your time sofar! :slight_smile:

Hello Christoph,
i am impressed it works!! I am able to close and open the shutter with node red and its UI.
I just have one “problem” I would like to just have to give an impulse or button (in german Taster)
Controlling the shutters with the Switch is weird, because i have to switch on and off to open and on and off to close.

This is my flow in Node red. Is it setup right? Can i config the flow, so i cannot have Up and Down switched at the same time?

Cheers Steve
image

Update:

i found the Taster (Button) in Node red.
The only problem that i have is, that when i click for example the down button it doesnt turn off automatically. It still leaves voltage on the Logo input, so nothing happens when i click the up button.

So i need a way to configurate the node red, so the button turns false right after clicking it.

Hi, sorry for not comming back to the topic… I haven’t seen that there was a reply …

first, nice that it is working with the nodered integration :slight_smile:
But honestly speaking, I am not yet sure what exactly needs to be setup to get the swtich functionallity…

Since I am using the LOGO integration to collect data from my terrariums, I haven’t had the need to actually controll the device - and when I did, I also faced an issue with button functionallity.

After creating a switch to turn on a light - it happened that I could not turn off the switch afterwards… ^^
I still need to do some more testing with this … hopefully, I can comeback within the next few days with a solution… :slight_smile:

Hi tyr0n,

I’ve done some further tests with my configuration and I was able to create a button that should now turn the lights on the Terrarium on / off when I press the button in HomeAssistant.

The problem I do see for your configuration is, that we don’t have this kind of switch button (Taster) as far as I know.
This means, that as long as the button state in HomeAssistant is set to ON it will keep the Signal true for the NI block in the LOGO.


This means, that you could trigger the UP or DOWN command with such a button - but if you want to stop the cover, you need to press the button again.

But this would work similar to the shutter switch we do have in HomeAssistant if you have a shutter control from another vendor (in my case homematic ip)…
there, we also just have a simple button…


As you can see, the button is currently active, the cover is OPEN.
When I do press the button the cover will start to close, until it is fully closed.

The button itself does also not have any “tap” functionallity, nor does stop the cover from closing until it is not fully closed.

For such kind of configuration, there are other entities available in HomeAssistant…

I need to see, how these could be integrated into NodeRed…
But in your specific case with the LOGO, my suggestion would be:

have two NI blocks (up + down) - and each of them will be triggered with one button.
As long as the button for UP is active, the cover will open, when the button is switched off, the NI will be set to off.
And vice versa for closing the cover.

Then, you should also consider of creating some fallback solutions (probably directly within NodeRed)…
the Button “down” can only be active, if the cover is open / partitially open…
You could also implement some kind of “timer”… but that’s nothing I can test right now, since I do not have any Logo left I could use for testing… :frowning:

Hello Chris, thanks alot for your help. I havent came back to this topic yesterday, i am sorry for that. I have found a way to handle the up and down. A Timer sets the button on false after 1s. I believe there are better ways to do it, but i cannot come up with one, because i just installed HA and Node Red last week.

Things i need to figure out:

  • Timer function. I havent found out how to do that yet. I tried putting a inject with repetition at a specific time, but i cant get time inject to click the button… :frowning:

  • I will have a look at the Shutter integration. I just need to figure out how to make my buttons a entity, but i will find out how…

  • A way to have Logo remember the actual status of the shutter. I need to see if there is a solution for that.

Hi Steve,

Why use node-Red as an intermediate ? Wouldn’t it be easier to use home assistant for this?

Integrate this into your configuration.yaml file.

modbus:
  name: hub1
  host: IP_ADDRESS
  port: PORT
  type: tcp 
  binary_sensors:
    - name: coverAuf
      scan_interval: 5
      slave: 1
      address: 8192 # this is the right address for your outputs
    - name: coverAB
      scan_interval: 5
      slave: 1
      address: 8193  # this is the right address for your outputs
  switches:
    - name: SwitchAuf
      write_type: coil
      slave: 1
      address: 0 # for v0.0
    - name: SwitchAb
      write_type: coil
      slave: 1
      address: 1 # for v0.1

A script example for controlling your NI. Either use the garphical interface or the script UI editor.

alias: COVER_OPEN_SCRIPT
sequence:
  - service: switch.turn_on
    target:
      entity_id: switch.SwitchAuf
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: switch.turn_off
    target:
      entity_id: switch.SwitchAuf
mode: single

Finally your shutter with the cover template :

Add the following in your configuration.yaml file. With the right script names.

cover:
  - platform: template
    covers:
      your_shutter:
        device_class: shutter
        friendly_name: "YOUR SHUTTER"
        open_cover:
          service: script.COVER_OPEN_SCRIPT
        close_cover:
          service: script.COVER_CLOSE_SCRIPT
        stop_cover:
          service: script.COVER_STOP_SCRIPT

Hello Gliena,
thanks for your reply. I went the other way because Chris helped me out on it and it was pretty easy to do.

Getting a connection via modbus shouldnt be a problem. I think i saw a video about it before.
Do i just add all the code above info the configuration.yaml ?

What is the difference between the binary_sensors name coverAuf and the switches name Switch_Auf

If i have for example 10 Shutters, do i need 10 binary_Sensors coverAuf, coverAB and 10 switches SwitchAuf and SwitchAb?

I edited my above post to say where you need to integrate the different code. It’s either in the configuration.yaml file or in a script. If you copy paste everything should work for your configuration for this shutter. What you still need to input is:

  • IP address
  • port for accessing the logo
  • address for your coils (for the switches), if you share your latest block diagram I can help if necessary

Once behind my computer i could share a printscreen on how to get the port number.

The switch_auf is what will trigger the action of your NI (network input). In my opinion it’s best to have somekind of readback about the status of your shutters. The binary sensor will get the state of your outputs (Q1 or Q2) either opening or closing. You could later use this information with some automation to put a state on your shutter (open or close)

You will need to have 10 x2 binary sensors and 10x2 switches but you can just keep 2 scripts (1 for opening and 1 for closing)

Hello gliena,

you guys are awesome! Once i get home i will try to configurate it. I dont have access to my HA from work, because the ports are closed at work :frowning:

Ok, so i tried to configure everything. Under Scripts → YAML Editor i only added the Cover Close Part:

'1633363059646':
alias: COVER_CLOSE_SCRIPT
sequence:
  - service: switch.turn_on
    target:
      entity_id: switch.SwitchAb_Kitchen
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: switch.turn_off
    target:
      entity_id: switch.SwitchAb_Kitchen
mode: single

Under Configuration.yaml i added:

modbus:
  name: hub1
  type: tcp
  host: 192.168.178.50
  port: 502

  binary_sensors:
    - name: coverAuf
      scan_interval: 5
      slave: 1
      address: 8192 # this is the right address for your outputs
    - name: coverAB
      scan_interval: 5
      slave: 1
      address: 8193  # this is the right address for your outputs
  switches:
    - name: SwitchAuf_Kitchen
      write_type: coil
      slave: 1
      address: 0 # for v0.0
    - name: SwitchAb_Kitchen
      write_type: coil
      slave: 1
      address: 1 # for v0.1

cover:
  - platform: template
    covers:
      your_shutter:
        device_class: shutter
        friendly_name: "Kitchen"
        open_cover:
          service: script.COVER_OPEN_SCRIPT
        close_cover:
          service: script.COVER_CLOSE_SCRIPT
        stop_cover:
          service: script.COVER_STOP_SCRIPT

My Dashboard looks like this:

The SwitchAb and SwitchAuf works fine, i have to turn it on and off so the Switch activates the Shutter.

When i try to click the Cover Template Down i get this error:

Fehler beim Aufrufen des Diensts cover/close_cover. Unable to find service script.cover_close_script

Did i add the Script wrong?

i put the address vor the switchAb_Kitchen to v0.1 not knowing what your program looks like. Can you make a printscreen of your program from logosoftware?

v0.1 is ok. The Switch entity works, but not the template

Have you tried to name it in small caps? I put everything in magiscul for you to change.

yes, i changed everything in small caps now: still the same error

image

Actually my bad, replace ‘1633363…’ with cover_close_script and it should work you can change alias or remove altogether