gce-electronics / HA_RFPlayer

RFPlayer plugin for Home assistant
Apache License 2.0
27 stars 9 forks source link

switch in home assistant ? #26

Closed Nick75wien closed 3 months ago

Nick75wien commented 1 year ago

Hello! Thanks for the integration in home assistant! I have installed it and so far it found 14 sensors. Some of them I know, some not yet.

But how can I now use them to switch on and of lights ?

KR Niki

Aohzan commented 1 year ago

Hello, => https://github.com/gce-electronics/HA_RFPlayer#usage

prahal commented 1 year ago

@Nick75wien if you want to control a device (a plug for one) you have to bind it, that is send a pairing message to the remote device (plug) to control that you have turned in pair mode at this time with its pairing button. (only sensors that broadcasts constantly their status are automatically detected and added as entities to homeassistant, ie pressing a button on a remote automatically creates a sensor in HA)

The way to create an entity for a plug is not obvious:

  1. in HA webUI go to "development tools"
  2. go to the "services" tab
  3. on this page enter "rfplayer.send_comment" in the service field
  4. in the command enter "true" (I don't know if this value matter but one has to be entered
  5. in the protocol field enter the protocol your device is meant to (and one that is supported by the rfplayer), for me it was "CHACON"
  6. check the box next to the device address. device address: you can choose an X10 address, choose one that you have not already entered, for me "A4" (X10 addresses are <1-16> https://en.wikipedia.org/wiki/X10_(industry_standard) (I believe the type of address depends on the protocol but for me, it was an X10 address. This will be memorized by your remote device (the plug here). You should be able to use the device_id instead of device_address but the device_id is specific to the remote device. For a sensor, you get the device id when it is autodetected (in its id) but I see no means to guess the device_id for a remote device that you want to pair to.
  7. switch the toggle 'create associated entity' if you want the binding to be kept (and not be a one-shot test)
  8. press the "call service" button while the remote device is in pair mode (by pressing the button on the remote device, here the plug)

This is pretty hardcore in my opinion.

prahal commented 1 year ago

for the protocol and device address see pages 13 and 14 of the rfplayer_api_v1.15.pdf

Nick75wien commented 1 year ago

thanks for your inputs:

The device were detected automatically: sensor.fs20_126943488

Still I didn't figure out which protocol to use to switch them to on via RF-Player

prahal commented 1 year ago

@Nick75wien "FS20" I suppose if it is an FS20 device. Could you tell the name of the device you want to turn on?

Nick75wien commented 1 year ago

Hello!

I attached a picture of the switch I am talking about! FS20 AS4-3 This is the user-manual in German: https://asset.conrad.com/media10/add/160267/c1/-/de/000623009ML05/manual-623009-as4-fs20-wireless-switch-4-channel-surface-mount-switching-capacity-max-3680-w.pdf

Can you help me, please ?

prahal commented 1 year ago

@Nick75wien what happens when you send_command with protocol "FS20"?

prahal commented 1 year ago

Note that as the command to bind a device, you should use "ASSOC". As device_ddress you could use "A1" for example.

@Nick75wien from your manual:

Press the control button of the corresponding channel on the device for at least 5
seconds.
The control lamp/LED of the respective channel starts flashing, the device is
in programming mode.
• Now press one of the desired button pairs on your remote control. Does he
If the wireless switch receives the code, the control lamp/LED stops flashing. The
Wireless switch is now programmed to this remote control.
• If necessary, programming can be done at any time by another button on the remote control
or another remote control channel. Again, proceed as above
described before.
• This programming process is to be repeated for all four switching channels as required.

simply send_command from HA instead of pressing one of the buttons on your remote control.