Autor Thema: Problem using Tradfri with FHEM  (Gelesen 297 mal)

Offline credulous

  • New Member
  • *
  • Beiträge: 15
Problem using Tradfri with FHEM
« am: 04 Dezember 2018, 17:28:35 »
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

Offline credulous

  • New Member
  • *
  • Beiträge: 15
Antw:Problem using Tradfri with FHEM
« Antwort #1 am: 05 Dezember 2018, 08:05:09 »
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


Offline credulous

  • New Member
  • *
  • Beiträge: 15
Antw:Problem using Tradfri with FHEM
« Antwort #2 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

Online Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 4714
Antw:Problem using Tradfri with FHEM
« Antwort #3 am: 05 Dezember 2018, 12:01:22 »
(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-T5740 mit Debian stretch (i386) + aktuellem FHEM | ConfigDB | VCCU mit einiger HM-Hardware | MySensors seriell (2.3.1-beta@RS485, div. konkrete Hardware, u.a. einige DS18B20) | Milight@ESP-GW@MQTT2 | zigbee2mqtt@MQTT2 | SIGNALduino | MapleCUN

Offline credulous

  • New Member
  • *
  • Beiträge: 15
Antw:Problem using Tradfri with FHEM
« Antwort #4 am: 05 Dezember 2018, 21:52:01 »
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

Online Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 4714
Antw:Problem using Tradfri with FHEM
« Antwort #5 am: 06 Dezember 2018, 07:18:05 »
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-T5740 mit Debian stretch (i386) + aktuellem FHEM | ConfigDB | VCCU mit einiger HM-Hardware | MySensors seriell (2.3.1-beta@RS485, div. konkrete Hardware, u.a. einige DS18B20) | Milight@ESP-GW@MQTT2 | zigbee2mqtt@MQTT2 | SIGNALduino | MapleCUN

Offline credulous

  • New Member
  • *
  • Beiträge: 15
Antw:Problem using Tradfri with FHEM
« Antwort #6 am: 06 Dezember 2018, 18:18:48 »
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

Online Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 4714
Antw:Problem using Tradfri with FHEM
« Antwort #7 am: 06 Dezember 2018, 19:04:15 »
 :) 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-T5740 mit Debian stretch (i386) + aktuellem FHEM | ConfigDB | VCCU mit einiger HM-Hardware | MySensors seriell (2.3.1-beta@RS485, div. konkrete Hardware, u.a. einige DS18B20) | Milight@ESP-GW@MQTT2 | zigbee2mqtt@MQTT2 | SIGNALduino | MapleCUN