Topic-icon Home Assistant

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
07 Feb 2022 16:53 #1 von Christian
Home Assistant wurde erstellt von Christian
Hello,

Is there someone who has integrated PHC in Home Assistant ?

I'm starting like this :

switch:
  - platform: command_line
    switches:
        spots_hallway:
          command_on: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"
          command_off: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"
          friendly_name: "Lights hallway"

And use it like this

  - type: button
    tap_action:
      action: call-service
      service: rest_command.spots_hallway
      service_data: {}
      target: {}
    show_state: false
    name: Spots
    show_name: false
    icon: mdi:light-recessed


First I see a message in the log (even if it works fine) : Command failed: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"


Second and the most important one is that of course home assistant don't know the status of the switch.

Do someone knows how I can do that ?

Thanks !

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
07 Feb 2022 17:45 - 07 Feb 2022 17:49 #2 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
I integrated PHC commands into Homeassistant by using the commands below

reading the status is not possible but in homeassistant it is indicated that the lamp is on after command is given. The icon of the lamp turns yellow and the slide turns blue.
below the command I used to convert the switch to a lamp

- platform: template
   lights:
     spots_hallway:
       friendly_name: 'spots hallway'
       turn_on:
         service: homeassistant.turn_on
          entity_id: switch.spots_hallway
       turn_off:
           service: homeassistant.turn_off
           entity_id: switch.spots_hallway


succes
Letzte Änderung: 07 Feb 2022 17:49 von Oude Maatman.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
07 Feb 2022 18:15 #3 von Christian
Christian antwortete auf Home Assistant
That's indeed nicer in ha. Thanks !

Unfortunately I see still the error in the log.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
07 Feb 2022 18:55 - 07 Feb 2022 18:57 #4 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
Hallo Christian,

Delete the friendly name command under
  - platform: command_line

Monique
Letzte Änderung: 07 Feb 2022 18:57 von Oude Maatman.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
08 Feb 2022 09:24 - 08 Feb 2022 09:27 #5 von Christian
Christian antwortete auf Home Assistant
Hi Monique,

Unfortunately I still get the error ?


  - platform: command_line
    switches:
        verlichting_hallway:
          command_on: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"'
          command_off: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"'
        verlichting_bathroom:
          command_on: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=2&EVT=3"'
          command_off: 'curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=3&EVT=3"'
...

  - platform: template
    lights:
      lights_hallway:
        friendly_name: "Lichten gang"
        turn_on:
          service: homeassistant.turn_on
          entity_id: switch.verlichting_hallway
        turn_off:
          service: homeassistant.turn_off
          entity_id: switch.verlichting_hallway
      lights_bathroom:
        friendly_name: "Lichten badkamer"
        turn_on:
          service: homeassistant.turn_on
          entity_id: switch.verlichting_bathroom
        turn_off:
          service: homeassistant.turn_off
          entity_id: switch.verlichting_bathroom
...

Even when deleting the friendly name under "platform: template" nothing helps...
Letzte Änderung: 08 Feb 2022 09:27 von Christian.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
08 Feb 2022 16:47 #6 von Oude Maatman
Oude Maatman antwortete auf Home Assistant
You cannot read a status in HA for the PHC system in HA for a lamp(but also shutters not). 
By turning the lamp on or off the system expects to get a status message back but this does not happen. Therefore the error message. You can ignore this 
see also www.home-assistant.io/integrations/light.template/

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Christian
  • Christians Avatar Autor
  • Offline
  • Junior Boarder
  • Junior Boarder
Mehr
08 Feb 2022 17:32 #7 von Christian
Christian antwortete auf Home Assistant
Thank you for the clarification !

Strange (and very unfortunate) that no one on the forum has managed to achieve that status (mqtt ?).

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
01 Jul 2022 10:27 #8 von simonjo
simonjo antwortete auf Home Assistant
Hi guys,

Just stumbled on this topic... and I can bring you some hope.

In another topic (Visualisierung -> Phc2Mqtt) I am discussing the Phc2Mqtt module. This is added to your existing PHC installation and provides a 2-way communication between MQTT and the PHC system in Proxy mode.

The module listens on the PHC module bus and translates the packets into MQTT messages, this way you can report status, events, commands.
You can also send commands via MQTT to the module which will translate them into PHC protocol format and send them to the real STM in your system.

I am currently working on an automatic integration of Phc2Mqtt into HA, it works in demo but needs refining.
How does this work? Simple, use the SystemSoftware v3.2.8 to transfer your project to Phc2Mqtt, then we take out the needed info from the project zip file and generate the needed config info for HA. You can advertise this info via MQTT and HA will take it in via it's MQTT Discovery feature.

What can you achieve? With this automation you can follow the status of your outputs (lights, shutters, ...) as they happen. So if yo press a button on the wall and a light goes on, then HA will reflect the light turning on. You can also control the lights/shutters/... via HA over MQTT.

For now I need to finish this sw part and the latest hw for Phc2Mqtt
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Powered by Kunena Forum