molobrakos / tellsticknet

Interface to a Tellstick Net device on the local network
MIT License
31 stars 15 forks source link

Problem with arctech - selflearning-dimmer #23

Open peterlindqnet opened 5 years ago

peterlindqnet commented 5 years ago

Hi,

Thanks for the nice software. I managed to get it working for my new Tellstick Net and some selflearning switches but I run into problems with my self learning dimmer. I have a previous setup with a Tellstick Duo that I want to replace.

The configuration for the Tellstick Duo is:

  id = 19
  name = "Vardagsrumslampa"
  controller = 0
  protocol = "arctech"
  model = "selflearning-dimmer"
  parameters {
    house = "1001019"
    unit = "5"
  }
}
device {
  id = 10
  name = "Vitrinlampa #1"
  controller = 0
  protocol = "arctech"
  model = "selflearning-switch"
  parameters {
    house = "1001001"
    unit = "5"
  }
}

I moved this to the new config file as:

---
name: Vardagsrumslampa
component: light
protocol: arctech
#controller: 0
unit: 5
house: 1001019
model: selflearning-dimmer
aliases:
  - protocol: arctech
    model: selflearning
    unit: 5
    house: 1001019
---
# a light command
name: Vitrinlampor  # name unique within component for commands
component: light
protocol: arctech
model: selflearning
# Old
#unit: 5
#house: 1001001
unit: 15
house: 59106122

The switch seems to work after I changed the unit and house values (picked them up using the listen --raw command).

The dimmer howerver does not seem to work. I tried to pick up the unit and house values but they seem to change.

Here is an example of the logs when I turn on / off the dimmer lights via the Tellstick Duo:

{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168978, "time": "2019-05-06T20:56:18"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168979, "time": "2019-05-06T20:56:19"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168980, "time": "2019-05-06T20:56:20"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168980, "time": "2019-05-06T20:56:20"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168980, "time": "2019-05-06T20:56:20"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168980, "time": "2019-05-06T20:56:20"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 500509, "unit": 3, "group": 1, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168981, "time": "2019-05-06T20:56:21"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 17778235, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168982, "time": "2019-05-06T20:56:22"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 500509, "unit": 3, "group": 1, "method": "turnoff", "lastUpdated": 1557168985, "time": "2019-05-06T20:56:25"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 7402595, "unit": 13, "group": 1, "method": "turnoff", "lastUpdated": 1557168985, "time": "2019-05-06T20:56:25"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 51332667, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168986, "time": "2019-05-06T20:56:26"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168987, "time": "2019-05-06T20:56:27"}
{"protocol": "arctech", "model": "selflearning", "class": "command", "house": 1001019, "unit": 5, "group": 0, "method": "turnoff", "lastUpdated": 1557168987, "time": "2019-05-06T20:56:27"}

I cannot seem to understand how the dim command is transmitted.

Do you have any suggestion on how to fix the dimming light?

peterlindqnet commented 5 years ago

I did some more troubleshooting, I found that moving the Telldstick Net further away from the old Telldstick Duo improved the signal and improved the consistency of the data.

However, it seems I can only get the Tellstick Net to pick up signal to turn off the selflearning-dimmer. Turn on commands and dim commands don't seem to show up at all when I run the "listen --raw" script.

Have you seen dimmer work with the code?

molobrakos commented 5 years ago

Hi, thanks for using and for reporting this issue!

I just tested in my setup and I can confirm that dimming works, at least for sending the commands from the tellstick. I tested with this command:

tellsticknet --ip=<ip> send korridor dim 20

(the dimmer value is a percentage 0-100)

My configuration for the light "korridor" is:

controller: abc123
name: Korridor
component: light
protocol: arctech
model: selflearning-dimmer
unit: 1
house: 11408680
aliases:
- protocol: arctech
  model: selflearning
  unit: 14
  house: 45213518

Does this work for you? As I understand, your issue is rather that you have problem receiving signals when you are using the external control to set the dim level (pressing the physical buttons on the remote), and you want to get a notification of the new dimming level, is that correct?

peterlindqnet commented 5 years ago

Hi,

Thanks for helping.

I have an old working setup with the Tellstick Duo that I want to migrate to the Tellstick Net. I was hoping to be able to just copy values from the old configuration file without needing to go through the selflearning process again.

The following works for turning the lamp on and off:

name: Vardagsrumslampa
component: light
protocol: arctech
controller: abc123
unit: 5
house: 1001019
model: selflearning

E.g. tellsticknet -vv --ip <IP> send Vardagsrumslampa off

If I instead set:

model: selflearning-dimmer

the turn on commands stops working, only the turn off command works. Dimmimg does not work at all, or the lamp does not react on the command at least.

The is a Nexa wall mount dimmer, it works well from the old Tellstick Duo.

I don't quite understand the aliases section of the configuration does and what value to put there. My old configuration only had a single unit and house.

Also, what does the controller entry mean?

I am afraid there is something I missed in the configuration.

peterlindqnet commented 5 years ago

I did some more troubleshooting.

I tried to go through the learning cycle for my dimmer (Nexa LWMR-210)

It seems all commands that are sent like below fail:

9-05-15 23:07.53 DEBUG (MainThread) [__main__] Waiting for tasks to finish
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.controller] Sending time 1 of 2
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.protocol] Encoding for protocol arctech
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.controller] Sending packet to controller ('10.192.1.219', 42314) <b'4:sendh1:S93:\x18\xff\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18s'>
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.util] Sending to sock <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 0)> 10.192.1.219:42314
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.util] Sending packet to 10.192.1.219:42314
19-05-15 23:07.53 DEBUG (MainThread) [tellsticknet.util] Wrote data to sock <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 60146)>: b'4:sendh1:S93:\x18\xff\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x18\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18\x7f\x18\x18\x18s'

Commands sent like below works like a charm:

19-05-15 23:18.48 DEBUG (MainThread) [tellsticknet.protocol] Encoding for protocol arctech
19-05-15 23:18.48 DEBUG (MainThread) [tellsticknet.controller] Sending packet to controller ('10.192.1.219', 42314) <b'4:sendh8:protocol7:arctech5:modelC:selflearning5:housei11cb0dbs4:uniti0s6:methodi2ss'>
markoku commented 1 month ago

Got this working, but problems with on/off socket. I have Rusta item 922011980101. Added to tellsticknet.conf following: "# pix3 name: Pix3 component: light protocol: arctech model: selflearning unit: 1 house: 4532"

It makes no difference as what I add this to telldus live, it says as protocol "kangtai". From telldus (https://developer.telldus.com/wiki/TellStick_conf) it says that kangtai is only supported by Tellstick net.

Is there something I can do about or something to test this further?