Page 9 of 13

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Wednesday 28 December 2016 11:15
by tuspam
inzimam wrote:Guys

I'm sorry I'm too much of a newbie here. I don't even know where to start to get this to work

I have an XP machine, a Broadlink RM Pro.

Looks like I need Domoticz for Windows and RM Controller?

Does anyone have some very simple starting steps please?
It's not for beginners, minimal skill needed. It's designed for linux based machines, raspberry pi etc. But maybe for windows too, but probably You need install first "python" and Domoticz.
You find all info on the web.

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Wednesday 28 December 2016 12:00
by forumfab
Curious answer

In computing the real competence is not to create a so called program, but to give to all the ways to use it easily

Assert that it is specialist affair, it often is to hide the fact of having no capacity to go at the end of a complete project

The RM BRIDGE on Android was created to be use by all

The plugin on JEEDOM, too, and it' s know ready, it was also created with the same idea

The TASKER plugin also

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Wednesday 28 December 2016 12:45
by tuspam
forumfab wrote:Curious answer

In computing the real competence is not to create a so called program, but to give to all the ways to use it easily

Assert that it is specialist affair, it often is to hide the fact of having no capacity to go at the end of a complete project

The RM BRIDGE on Android was created to be use by all

The plugin on JEEDOM, too, and it' s know ready, it was also created with the same idea

The TASKER plugin also
So try to configure everything first on windows and then write some noobs friendly how to. I was do that for linux based devices.

Cheers

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Wednesday 28 December 2016 17:47
by forumfab
Hi

there is no linux approch for Python
If it's working on linux, it's working on windows !

The demand is about a full fonctionnal tool, easy to install, and not a toy for geeks that think to be specialist .

You seems to be a little nervous .

May be you do want to do more, it's you right , but don't affirm that the solution is workink ..

Just and exemple on the basic linux that is install for DOMOTICZ, all the librairies that are use in the 5 firsts lines are'nt not implement

setuptools not implement on Basic DOMOTIC

Crypto.Cipher not implement on basic DOMOTICZ

And so on ...

The user must install some of them ..

Cheers too

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Wednesday 28 December 2016 19:49
by inzimam
Could you please help with this then at least:

My current setup is using the RM Bridge and I have got to work fine with Alexa, apart from the Broadlink Switches which have a code too long for the RM Bridge. I may be able to resolve this by trying again with a RF Learning Remote or using the RM Tasker Plugin app (I'm trying to figure out if I can run this on my Amazon Fire TV which is where I'm running the RM Bridge)..

Currently the Devices all show up as as SmartThing device so Alexa can see and use them. I'm going to add Philips Hue lights and these will also show up separately.

So can you please tell me what the advantage of using Domoticz is?

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 11:12
by Tyalis
Hi there, I've just ordered the Broadlink RM2 and noticed a plugin has been release for Jeedom which does not required to use the RM Bridge nor any Android platform. It's free on their plugin store.
Could someone confirm and/or tell if we're now able to manage the device directly from Domoticz ?

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 11:35
by forumfab
Tyalis wrote:Hi there, I've just ordered the Broadlink RM2 and noticed a plugin has been release for Jeedom which does not required to use the RM Bridge nor any Android platform. It's free on their plugin store.
Could someone confirm and/or tell if we're now able to manage the device directly from Domoticz ?
Hi Yalis,

The answer is yes for JEEDOM
The answer is NO for Domoticz

in the actual state , on Domoticz it's just à piece of differents parts, that couldn't be easy install, and use.

Bests regards

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 11:48
by Tyalis
Hi forumfab, thanks for your quick answer.

Is it no possible to retro-engeneer the Jeedom plugin to see how it's able to manage the Broadlink without RM Bridge and code the same way into a script or any other component that can be handled by Domoticz ?
Is it not as easy as looking what requests the official application sends and then send the very same through a script ?

I'm sorry if my questions are stupid as I'm quite new to the domotic world but I'm very surprised of the need of that Android bridge.

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 13:04
by forumfab
Tyalis wrote:Hi forumfab, thanks for your quick answer.

Is it no possible to retro-engeneer the Jeedom plugin to see how it's able to manage the Broadlink without RM Bridge and code the same way into a script or any other component that can be handled by Domoticz ?
Is it not as easy as looking what requests the official application sends and then send the very same through a script ?

I'm sorry if my questions are stupid as I'm quite new to the domotic world but I'm very surprised of the need of that Android bridge.
Hi Tyalis,

JEEDOM and DOMOTICZ are based on two differents approaches

JEEDOM is using Plugings , and the RM' Jeedom's solution is base on a plugin

The best solution could be to ask to the JEEDOM developper, if it could get an interest to help the Domoticz Users ...

Here is the forum' page about the Plugin

https://www.jeedom.com/forum/viewtopic. ... &start=100

You can let your demand in English

The developper is sarakha63

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 13:42
by Tyalis
Ok I've read that post and I've just noticed that the solution had already been given here too, my bad.
The python library does not require the RM Bridge so we are well able to use the Broadling without it. The Jeedom plugin make use of that library and allow creation of a daemon for ease of use.

It would still be great to have native support in Domoticz. Do you know if it has already been asked to Domoticz developers ?

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 14:56
by forumfab
Tyalis wrote:Ok I've read that post and I've just noticed that the solution had already been given here too, my bad.
The python library does not require the RM Bridge so we are well able to use the Broadling without it. The Jeedom plugin make use of that library and allow creation of a daemon for ease of use.

It would still be great to have native support in Domoticz. Do you know if it has already been asked to Domoticz developers ?
Hi TYalis,


I think that nobody did for the moment

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Thursday 05 January 2017 19:20
by Doler
I'm not knowledgeable in that area but maybe the new python plugin development (beta) creates an opportunity? Just a thought.

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Friday 06 January 2017 11:47
by markT
Hi there.
This looks like an excellent integration. I've just place an order for the RM2 but I can't work out how to install the library for use in Python.
Can anyone help me please - apologies if I'm being dumb :-)

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Friday 06 January 2017 22:43
by anatopeck
Helllo

I am sad the tweak between broadlink RM2 and Domoticz, it's only for raspberry :( It's not available for my syno maybe one day if jumbro got enough time to add the RM2 into the device list :)
Anyway thanks again jumbotroll and the team

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Monday 09 January 2017 20:48
by madrian
I just ordered a RM3 Mini. I want to control my Air Conditioner. As I saw, it is possible to control (on/off, change temperature, mode, fan speed) from the official app, but I am nut sure with the Python code.

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Monday 09 January 2017 23:26
by MadBanana
I have an RM3 mini and I've had mostly successful recording and playback of code using the python routines. Where I'm struggling at the moment is with dimmer that need a short press to turn on / off and a longer one to dim up / down. I can't seem to get the recorded length right.

But in the main, all is good!

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Tuesday 10 January 2017 23:31
by Smurfen
Hello! I don't get any error running learn and play command, but I do not get any IR light from my RM PRO-E unit.
I run a "Dummy" dometicz switch script: script:///home/domoticz/scripts/python/playcode.py /home/domoticz/scripts/python/soundOn.txt
To send IR code to my Logitech Z-5500 system and turn it ON/OFF.
Is there any way to send a test to the RM PRO-E IR signal within Raspberry PI:s root (pi@raspberrypi:~ $) ??
My Ip address and MAC adresses are correct.

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Monday 23 January 2017 20:59
by moacir
Hi! Until yesterday i used my Raspberry Pi 2 (cron + curl to send http requests) and RM Bridge to automate my RF switches. But today i decided to install Domoticz and python-broadlink. Now my system does not depend on 3 devices (raspberry, android tablet and the RM2 broadlink), but only two (raspberry and RM2) and all managed by just an accessible secure (HTTPS) interface from any web browser!!! And there's a fantastic free cell app (Android in my case) that can connect automatically to the internal and external network (3G, 4G). I have found that learn.py does not copy RF codes, just IR. But it is very easy to work around this, just use RM Bridge to clone the RF codes and then copy them to a txt file, by removing the code header and entering only the HEX code.

Now I have some doubts, since I'm not very acquainted with python and Domoticz yet:
- Is there any way to get the sensor temperature built into RM2 through python-broadlink and put it as a sensor in Domoticz?
- Is there any way to get the Broadlink A1 Sensor (i have one) readings through python-broadlink and put the values as sensors in Domoticz?

I would be very grateful if anyone with more experience could guide me on these issues. If this is possible, a Raspberry Pi (now version 3 and more powerful) will become the only IoT manager for a home: samba server for file sharing (i use), Transmission Bittorrent (i use), Zoneminder for IP camera management and record (i use), Webmin for Raspberry management (i use) and Domoticz for automation (for now i use only RM2, but in the future I'll use GPIOs). And all this consuming a minimal amount of electricity. My UPS APC BR-1500 (old model) with the battery pack (6 total 12V x 9Ah) keeps my system for ~5 hours (modem + router + brazilian JFL alarm central + raspberry + RM2 + A1 sensor + two IP cameras 720p + Samsung 1TB portable HDD + Seagate 5TB portable HDD).

Thanks!

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Tuesday 24 January 2017 8:56
by aldodemi
Here a script to read RM2 temperature sensor, where 192.168.0.15 is the IP address for YOUR RM2 and "XX YY ZZ KK JJ WW" is its mac address, TEMP_IDX the index for the virtual switch in domoticz:

Code: Select all

#!/bin/bash
#
DOMO_IP="127.0.0.1"                     # Domoticz IP Address
DOMO_PORT="8080"                        # Domoticz Port
TEMP_IDX="824"                          # IDX for Virtual switch temperature

cd /home/domoticz/domoticz/scripts/python/broadlink/

function sensore {
python - <<END
import broadlink
import time
device = broadlink.rm(host=("192.168.0.15",80), mac=bytearray.fromhex("XX YY ZZ KK JJ WW"))
device.auth()
sensor = device.check_temperature()
print sensor
END
}

# Call it and capture the output
SENSORE=$(sensore)
echo Sensore: $SENSORE
temperature=$(echo $SENSORE | cut -d' ' -f8 - | tr -d ,)
echo $temperature
#
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$TEMP_IDX&svalue="$temperature""

Re: Using BROADLINK RM2 on DOMOTICZ

Posted: Tuesday 24 January 2017 9:01
by aldodemi
Here a script to read A1 sensors, where 192.168.0.16 is the IP address for YOUR A1 and "XX YY ZZ KK JJ WW" is its mac address, varius xxxx_IDX the index for the virtual switchs in domoticz:

Code: Select all

#!/bin/bash
#
DOMO_IP="127.0.0.1"                     # Domoticz IP Address
DOMO_PORT="8080"                        # Domoticz Port
AIRQ_IDX="821"                          # IDX for Virtual switch air_quality
LIGHT_IDX="822"                         # IDX for Virtual switch light
NOISE_IDX="823"                         # IDX for Virtual switch noise
TEMP_IDX="819"                          # IDX for Virtual switch temperature
HUM_IDX="820"                           # IDX for Virtual switch humidity

cd /home/domoticz/domoticz/scripts/python/broadlink/

function sensori {
python - <<END
import broadlink
import time
device = broadlink.a1(host=("192.168.0.16",80), mac=bytearray.fromhex("XX YY ZZ KK JJ WW"))
device.auth()
sensors = device.check_sensors()
print sensors
END
}

# Call it and capture the output
SENSORI=$(sensori)
echo Sensori: $SENSORI
#
# Esempio output {'air_quality': 'excellent', 'light': 'dark', 'noise': 'quiet', 'temperature': 23.3, 'humidity': 48.0}
#
air_quality=$(echo $SENSORI | cut -d' ' -f2 - | tr -d ,)
light=$(echo $SENSORI | cut -d' ' -f4 - | tr -d ,)
noise=$(echo $SENSORI | cut -d' ' -f6 - | tr -d ,)
temperature=$(echo $SENSORI | cut -d' ' -f8 - | tr -d ,)
humidity=$(echo $SENSORI | cut -d' ' -f10 - | tr -d })

#/json.htm?type=command&param=udevice&idx=IDX&nvalue=HUM&svalue=HUM_STAT
# IDX =idx de votre capteur. A obtenir depuis l’écrans des dispositifs.
# HUM = Humidité: 45 par exemple pour 45%
# HUM_STAT = Humidity_status
# Humidity_status peut être :
#
# 0=Normal
# 1=Confortable
# 2=Sec
# 3=Humide
# Ce paramètre est obligatoire, si vous ne savez pas quoi mettre, mettez 0

hum_stat=0
#if [ $humidity<25 ]; then hum_stat=2; fi
#if [ $humidity>60 ]; then hum_stat=3; fi
#if [ $humidity>=25 && $humidity<=60 ]; then hum_stat=1; fi

case $humidity in
[0-25])
  hum_stat=2
  ;;
[26-60])
  hum_stat=1
  ;;
[61-100])
  hum_stat=3
  ;;
*)
  hum_stat=0
  ;;
esac

echo $air_quality
echo $light
echo $noise
echo $temperature
echo $humidity
echo $hum_stat

curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$AIRQ_IDX&svalue="$air_quality""
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$LIGHT_IDX&svalue="$light""
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NOISE_IDX&svalue="$noise""
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$TEMP_IDX&svalue="$temperature""
Sensor hum_stat at the moment doesn't works...