Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homeassistant integration #47

Open
OevreFlataeker opened this issue Jun 20, 2023 · 1 comment
Open

Homeassistant integration #47

OevreFlataeker opened this issue Jun 20, 2023 · 1 comment

Comments

@OevreFlataeker
Copy link

I flashed my Lidl Silvercrest SWS A1 power plug with your firmware without problems and everything works very well. Thank you for this!

With the original firmware I used FHEM and the "magic" paket to UDP 8530 to control power on/off.

Now I want to integrate the plugin using Homeassistant. However the new device is of course not automatically recognized in the integrations.

If I understand it correctly I can only perform the switching now using http calls to
http://<ip:8080>/state?sw=1 and ?sw=0 ?

There is no option to send it MQTT message to toggle the switch state? The MQTT integration is only one way? Is it possible to retrofit the old way of sending the UDP packet as well or is there not enough room in the firmware for this?

HTTP Auth: Where do I set the actual password? I can only (de)activate but do not see where the username/password can be specified?

I see the original webpages are still served at port 80. Do I need to use those for this configuration, i.e. is the complete configuration done as a combination of the legacy configuration and your addons?

Thanks!

@sshaikh
Copy link

sshaikh commented Sep 8, 2024

MQTT wasn't working for me so this is what I ended up with:

rest_command:
  smart_socket_off:
    url: http://hfeasy:8080/state?sw=0
    username: !secret smart_socket_user
    password: !secret smart_socket_password
    verify_ssl: false
  smart_socket_on:
    url: http://hfeasy:8080/state?sw=1
    username: !secret smart_socket_user
    password: !secret smart_socket_password
    verify_ssl: false

binary_sensor:
  - platform: rest
    name: "Smart Socket State"
    unique_id: xxxx
    resource: "http://hfeasy:8080/state"
    verify_ssl: false
    value_template: '{{ value_json.relay_status }}'
    username: !secret smart_socket_user
    password: !secret smart_socket_password

switch:
  - platform: template
    switches:
      smart_socket:
        friendly_name: "Smart Socket"
        unique_id: yyyy
        value_template: "{{ is_state('binary_sensor.smart_socket_state', 'on') }}"
        availability_template: "{{ is_state('binary_sensor.hfeasy', 'on') }}"
        turn_on:
          - service: rest_command.smart_socket_on
        turn_off:
          - service: rest_command.smart_socket_off

where binary_sensor.hfeasy is a ping sensor pointing to the hfeasy device (configured via the UI). This may not be needed however but seems better than timing out the HTTP if the socket is powered down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants