New platform for My Home bTicino


#1

Hi, I’m new in the forum and also in Home assistant.
I try to create a new platform for My Home bTicino .
I’m not a great programmer and I’m new on Python, but following the Development info on the documentation of home assistant I’m able to turn on and off the light and to read the temperature from bus, but only if I write the Class that read/write the bus directly in the python module where i setup the PLATFORM (my_home.py)

I try to create a Class to read the bus, but I don’t understand how to IMPORT in the my_home.py file I write.
I insert in the DEPENDENCIES the file name I upload in Pypi, but
every time I get an error
import OpenWebNet
ModuleNotFoundError: No module named 'OpenWebNet’

Someone can give me some help or indication about documentation where to found the step to follow in order to solve the problems.

Thank’s in advance for help


Bticino MyHome?
#2

Hi,
this problem is solved. I made an error preparing the dist for Pypi.
Now the platform is running, but there are a lot of error I have to solve.


#3

Why do you need new platform?
Why can’t you use this one https://www.home-assistant.io/components/scsgate/?


#4

Why I don’t want to use an external pcboard to connect when I have a gateway connected on the lan


#5

Now the light seem ok


#6


#7

Hello Clau67,
I’m interested too, can you share your development?
Were you also able to monitor the gateway so that switch status is updated also when light is switched on/off from the wallmount?

thanks


#8

Hi Clau67,
I am also interested can you share your progress with us?
I am new to the word of Home Assistant and any help will be very appreciated.
I do have Bticino My home cabled system in my house and I want to get the best out of it.
Are you having the same configuration?
Ciao


#9

Hi,
I upload here the actual state for this platform


The platform is able to monitor the light status also if you use wall switch, and can also monitor the thermal unit and probe of the system.
There is a delay caused of the update of the system, but it can be reduced if you
add:

_emphasized text_scan_interval: number of sec for update

in the light platform

by default is 30 sec


#10

Hi Clau67,
thank you very much for sharing, I tried to install it but I get the same error you had:

File “/config/custom_components/light/my_home.py”, line 23, in
from OpenWebNet import OpenWebNet
ModuleNotFoundError: No module named ‘OpenWebNet’

can you help?

thanks a lot.


#11

You have to install from Pypi the OpenWebNet module

pip3 install OpenWebNet

In the next day I’ll update the my_home.py .
I introduce the switch but I’m still testing it


#12

Hi, Clau67,
I tried to install the custom component, I use Hass.io

I also installed OpenWebNet from the terminal with the command pip3 install OpenWebNet
I also updated pip3 to 10.0.1 and give me these errors:

core-ssh:~# hassio homeassistant check
ERROR
starting version 3.2.4
Testing configuration at /config
Failed config
General Errors:
- Platform not found: light.my_home
- Platform not found: sensor.my_home
Successful config (partial)
core-ssh:~#

Any suggestions? Thank you.

My configuration

######## Configuration.yaml file ########

######## MyHome bTicino ########
my_home:
host: 192.168.1.2
port: ‘20000’
password:! secret myhome_password

######## MyHome bTicino light ########
light:

  • platform: my_home
    devices:
    • name: test
      indirizzo: 21

sensor:! includes sensors.yaml

######## sensors.yaml file ########

######## Sensor MyHome ########

  • platform: my_home
    devices:
    • name: temp
      indirizzo: 51

######## path
/config/custom_components/Sensor/my_home.py
/config/custom_components/Light/my_home.py
/config/custom_components/my_home.py


#13

Hi Caiosweet,
it seems like if the platform is not present, so check all this and try again:

  1. There are 3 files on GitHub, the firs one is on the root my_home.py and is for create the platform, this must be copied under custom_components

  2. Then you have to create (us have you done) the two directory Light and Sensor and copy in it the other two file you find under the matching directory

The configuration.yaml seem correct , if you respect the indentation, but change address to indirizzo ,sorry but I haven’t translate for the moment all file in English :grinning:
Let me know


#14

thank you
I’m Italian too, sorry, I’ve also translated “indirizzo”

I think the problem is “Hassio”, and the installation of openwebnet.
I do not know how to install openwebnet, I think I need an addon :frowning: or the right command to install it on hassio

Thanks anyway.

PS after the hassio upgrade to 68 openwebnet has disappeared and I have reinstalled it like this:

➜  / pip3 install OpenWebNet==1.0.1 --no-cache
Collecting OpenWebNet==1.0.1
  Downloading https://files.pythonhosted.org/packages/86/b4/8e33fda92bd51c5e2bc0d7fc7df10f4a31ddf0e1227b30b6d7944b5d477d/OpenWebNet-1.0.1.tar.gz
Installing collected packages: OpenWebNet
  Running setup.py install for OpenWebNet ... done
Successfully installed OpenWebNet-1.0.1

➜  / pip3 freeze
awake==1.0
OpenWebNet==1.0.1
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

#15

Hi Caiosweet,
I thin you are right, could be “Hassio” the problem.
I’m using on Hassbian and I don’t have this problems:
I have some other problems but maybe I solved them today.
I’m doing some test.
Then if all ok, I’ll update all file.


#16

Hi all
I have create a new version of OpenWebNet class and the new my_home platform for HA.
You can find it on GitHub.


#17

hi guys,
I have painstakingly reverse engineered the official software, and am able to list all devices in the system and their configuration (working on programming)
see http://github.com/sxpert/myhomepy


#18

Unbelievable! so are you able to make the official component? can also be used for HASSIO?


#19

I do not know how, but I managed to make it work, the only problem is that it is slow, because it does not recognize the password … and it goes several attempts before it works (use MH200N)


#20

Hi caiosweet,
the password recognition, it’s only one time when HA is starting, then if there aren’t problem on the net the password recognition is no longer used.
If I remember correctly with MH200N you can set a numbers of IP address that are able to connect with the gateway without the password.
Have you insert the IP address of your pc where Home Assistant is running on ?
I develop the OpenWebNet class in order to connect with my HL4684 that is not able to do this, so I need in any case to recognize the password.
This happen when the platform is setup.
If your system don’t ask for this could be that OpenWebNet class ask for something but your MH200N answer something other.
I used the new platform on an Hassbian and on a MacOS, and on both function.
But I don’t have HASSIO, for test it.:thinking:
Could you send me the log file, so I check if there is some info or error that can give me some indication about the problems
Please check it before to send, be sure you don’t give any personal info.