Hi there Torben,
Of course I will try to help you. I assume you are running OpenHab on Linux, so all you have to do is:
Download httpie or modify the script to use curl (you can find instructions in the previous posts)
Save my script to some location on your Linux host (in a filename let’s say dirigera.sh"). Don’t forget to add execution rights to this script
chmod a+x dirigera.sh
Download dirigera-client-dump.jar from here: Releases · dvdgeisler/DirigeraClient · GitHub
read the pre-requirements on: GitHub - dvdgeisler/DirigeraClient: Dirigera Client API: Java written client API to interface IKEA's new smarthome hub DIRIGERA
Set up your router to give dirigera a static IP address (let’s say it will be 10.10.3.33 - change it to your configuration in below scripts)
Now you need to open a Linux terminal and run downloaded .jar file:
java -jar dirigera-client-dump.jar --dirigera.hostname=10.10.3.33 --dirigera.port=8443
then you will have to press the button on the dirigera device to issue a token. When pressed (after a few seconds) it will dump all your devices from dirigera and save the access token. Do not close the terminal, but press ctrl+c to exit the execution of the dump program.
Now you can display your token:
cat dirigera_access_token
Copy this long string and replace the value of TOKEN in my script.
Now look at the output from the dump program in linux terminal. Especially look for customName - if you find your device name, look for the first “id” value a few lines above the customName - this is the device id for your device. Replace the id with your value for any device in my script and try to control it.
Example output:
"id" : "dcb15556-6468-4959-ae6f-47766094d193_1",
"type" : "light",
"deviceType" : "light",
"createdAt" : "2022-12-09T19:44:07.000Z",
"isReachable" : true,
"lastSeen" : "2023-08-11T01:12:02.000Z",
"attributes" : {
"customName" : "Table lamp",
"model" : "NYMANE PENDANT",
"manufacturer" : "IKEA of Sweden",
"firmwareVersion" : "2.3.087",
"hardwareVersion" : "1",
"serialNumber" : "50325FFFFE6660DE",
"productCode" : "LED1805E22EU",
"isOn" : false,
"startupOnOff" : "startOn",
"lightLevel" : 33,
"colorTemperature" : 2202,
"colorTemperatureMin" : 4000,
"colorTemperatureMax" : 2202,
"colorMode" : "temperature",
"identifyStarted" : "2000-01-01T00:00:00.000Z",
"identifyPeriod" : 0,
"permittingJoin" : false,
"otaStatus" : "upToDate",
"otaState" : "readyToCheck",
"otaProgress" : 0,
"otaPolicy" : "autoUpdate",
"otaScheduleStart" : "00:00",
"otaScheduleEnd" : "00:00"
},
"capabilities" : {
"canSend" : [ ],
"canReceive" : [ "customName", "isOn", "lightLevel", "colorTemperature" ]
},
Other useful information is “canReceive” - these are list of commands that devices can receive. In my script I use a few examples like “colorTemperature” for lights - modify it to match what the device can receive and you are good to test it by running the script from the command line
./dirigera.sh <device-name> <command>
If it works, you can add either a exec-binding thing in Openhab or you can just create the rule to execute the script like this:
executeCommandLine(Duration.ofSeconds(10),"/your/path/to/dirigera.sh","table-lamp","ON")