Problem using Tradfri with FHEM

Begonnen von credulous, 04 Dezember 2018, 17:28:35

Vorheriges Thema - Nächstes Thema

credulous

Hello,

I have been using FHEM for a whille now, including Tradfri without any problems, but I have decided to install everything fresh with the latest OS, FHEM etc .. I am now running FHEM 5.9 on Raspberry pi. It all works fine except for Tradfri plugin

I Followed the instructions Peter's here https://github.com/peterkappelt/Tradfri-FHEM , but after compiling libcoap, I am unable to generate a pre-shared key (as per here https://github.com/peterkappelt/Tradfri - FHEM / issues / 11 ).

This is what I get when I try to generate a PSK, my assumption is this is a problem in libcoap, but has any one else experienced this?

root@fhem:/usr/local/bin# coap-client -m post -u "Client_identity" -k "MY_SECURITY_CODE" -e '{"9090":"IDENTITY"}' "coaps://my_gateway_ip:5684/15011/9063"
v:1 t:CON c:POST i:c822 {} [ ]
decrypt_verify(): found 24 bytes cleartext
decrypt_verify(): found 4 bytes cleartext
4.00


Any thoughts on what I have done wrong?

Thanks

Steve

credulous

I have switched over to Jtradfri and my bulbs are working again now.

I am not getting updated readings though for my new Ikea sockets when I turn them on either via the Ikea App or from NodeRed, below is my FHEM config for a socket, which is a copy of my work bulb config .. any thoughts on what I am missing?

define IKEAskt01 TradfriDevice 65557
attr IKEAskt01 alias Christmas_tree
attr IKEAskt01 autoUpdateInterval 1
attr IKEAskt01 group Lamps
attr IKEAskt01 room Lights,Livingroom
define MQTT_IKEAskt01 MQTT_BRIDGE IKEAskt01
attr MQTT_IKEAskt01 IODev IOT_MQTT
attr MQTT_IKEAskt01 publishReading_softwareVersion house/sockets/Livingroom/christmasTree/softwareVersion
attr MQTT_IKEAskt01 publishState house/sockets/Livingroom/christmasTree
attr MQTT_IKEAskt01 qos 2
attr MQTT_IKEAskt01 retain 1
attr MQTT_IKEAskt01 stateFormat transmission-state
attr MQTT_IKEAskt01 subscribeSet qos:2 retain:0 house/sockets/Livingroom/christmasTree/state


credulous

I think Jtradfri does not support sockets yet, I have opened a bug report, as the devices do not show in Tradfri Gateway devices list .. see image attachment

Beta-User

(a little OT:)

You may rather use MQTT_GENERIC_BRIDGE than MQTT_BRIDGE to link FHEM devices to the MQTT world - seems like you plan to have a bigger amount of Devices to be bridged ;) .

Then you'll need just one additional device to bridge all you Tradfri gadgets. The additional settings for MQTT are then done in the tradfriDevice-devices.

Kind regards, Beta-User
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

credulous

Thanks for the tip about MQTT_GENERIC_BRIDGE, I will check the documentation. I have to be honest that my configuration was copied from some simple examples and after I got it working I just multiplied as I add more devices!

Thanks

Steve

Beta-User

You're wellcome!

Most of the users here started that way, and you achieved what you wanted.

Generic Bridge is a relatively new module, so you won't find that much examples and there's no need to reconfigure anything (might be different the day you want to switch over to the also new MQTT2_CLIENT as interface to your broker. This won't work with MQTT_BRIDGE and offers encryption possibillities).

But don't forget: Rome wasn't built within one day...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

credulous

Ah that makes a bit more sense now you mention MQTT2_CLIENT, good to know it offers encryption, this was the reason I left MQTT without Encryption! I will look into this and fix.

Thanks

Steve

Beta-User

 :) Please note:
This functionality is relatively new (only a couple of weeks since MQTT2_CLIENT was born and hexenmeister added that type of IO to Gen-Bridge). So you are one of the first users to make use of that.

You seem to know what you'r doing, so don't worry too much about the risks ;) . In case you experience any strange behaviour, don't hesitate to post also in the MQTT part of the forum in english, you'll get an answer.

Afaik, you might use both type of IO towards your broker in parallel allowing a smooth transition between both and some testing before "going the big step".

Good success, would be nice to hear, if everything worked as expected.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

micha42

Zitat von: credulous am 05 Dezember 2018, 08:27:33
I think Jtradfri does not support sockets yet, I have opened a bug report, as the devices do not show in Tradfri Gateway devices list .. see image attachment

The socket is visible in Tradfri Gateway devices list after pushing "get TradfriGW DeviceList" button.

Switching on/off (after creating device manually) from FHEM is possible, but also no state feedback if the socket is controled by the (hardware) remote control switch.