I created 2 addons to integrate the German automation hub Smart Friends into Home Assistant. There is a simple REST gateway which can be polled for information and there is also an MQTT variant which once you have mapped the Smart Friends device ID to a hassio device type, they will be available in the MQTT integration.
The Smart Friends hub has support for a number of proprietary devices like the Schellenberg line of automated shades (Rollladen). It also has Z-Waze and Zigbee support. Although Iâve found that anything beyond a simple switch or sensor isnât supported.
With my addons the devices integrated seamlessly and easily into the hassio environment.
I have no problems connecting nor have I heard reports from anyone else. There is an embedded certificate but this is extracted from the SmartFriends Android app. I just checked this certificate and it expires on Oct 27 07:58:26 2036 GMT. So I donât think this is a problem with the bridge.
I suspect your system clock is wrong or the SmartFriendâs clock is wrong. Usually expiration errors on valid certificates are to do with incorrect system times. Try checking your date information and if that doesnât work then post the full error message.
Thank you for your reply, you were right. I have blocked access to the internet for my smartfriendsbox in order to avoid automatic upgrades. It probably didât synchronise the time correctly. I opened the firewall, and after upgrading to 2.20 it is now working, both your integration as well as the original node scripts from LaPablo.
Hello Gimp Arm,
First of all, thank you very much for the great add-on. Iâm new to the Home Assistant area and I canât get my Schellenberg shutters up. The button for it is dark. In addition, the status is not displayed to me. What can I do?
Thank you
Yeah, I can help. First I need to know if youâre using the REST functionality or the MQTT. I also need you to post the output of the /list call, so something like http://yourhassioip:5001/list
Also, it definitely works from the SmartFriends official app? If it doesnât work there then its not going to work here.
Although based on your data from /list there is no position sensor so that wonât work. If you can show me the entire output of /raw then I can check if position is a possibility or not. You might not have one in which case it can be set by time in Hassio but if anyone moves them outside of Hassio then it wonât know the position.
Iâm sorry, I should have clarified, I need the raw output directly after a restart of the addon. You can use https://pastebin.com to share it more easily.
After you changed the shell_commands, where the devices working better?
Immediately after the restart I only get a message from the browser that the connection was refused and then this output appears immediately.
Changing the shell_commands did not help, the sensor still shows the status unknown. I will now send you my complete configuration entries because I think I have configured anything wrong:
Although youâre getting the error because the bridge has no knowledge of the position sensor. I suspect there is no position sensor and the app just does it based on time. Maybe you had to calibrate how long it takes to go up and down and when you tell it to go to 50% it just does 50% of the time. I bet if you moved the shutters outside their app, it would not have the correct position.
The only way I can confirm if you have a position sensor or not is by that raw dump. So I urge you to try it again.
I could add a time based position into my bridge but if you ever moved the shutter outside the bridge then it would lose track and Iâm not sure how to regain it. Iâll have to think about it more and maybe I can come up with something Iâll be happy with.
Hi @GimpArm ,
thanks a lot for the smartfriends add-on. I am using the MQTT way to get the shutters into HomeAssistant and they show up just fine. I can also control them via HomeAssistant, but HomeAssistant does not correctly reflect the state of these shutters.
F.E. I just closed one shutter and in the add-on log I can see that it correctly received the new state from the Smartfriends box, but it did not forward this new state change to MQTT, so I think something is not working correctly in the add-on.
Second issue, or rather question: Is there any way to get some sort of âbusyâ state while the shutters are moving? I am asking because I would like to have a physical two button control for the shutters, and the automation logic needs to know what the shutter is currently doing so that it can act accordingly (stop, move opposit direction etc).
edit: hmm, some shutters seem to report their position, others do not and also have far less attributes. But regarless of that, in HA the device state is for all unknown
Sorry for the delay, I will try to help you but I broke my leg and Iâm not as active at the moment.
First step would be to check the current state in the smartfriends bridge. So we can narrow down whether it is the MQTT side or the smartfriends side. Go to what ever address you have set up in your browser http://homeassistant:5001/list You will see the data how my system Interprets it from the smartfiends hub. Under âdevicesâ you should see a âpositionâ entry which has a âcurrentValueâ value. If you do not see this there is a chance your shutters do not report their current position. I only have Schellenberg Rollodrive 65 Premium in my house and I know those report position but I know there are some models that do not. If you believe yours do report position but you are not seeing it in the list then I would need you to send me the output from http://homeassistant:5001/raw a few seconds after the plugin has newly started. That is the data I get from the smartfiends hub and based on that I can tell you what information is available. There is no private data in that, only your device names but nothing more.
For busy state, I can only tell you what the smartfreinds hub makes available. For my shades each device has a ârollingShutterâ device which has a âcurrentValueâ of either up, down, or stop. That would be your busy indicator. When it is up or down then you know it is moving. If you want to make use of this you can edit your /config/smartfriends2mqtt/typeTemplate.json and change it based on the HASSIO documentations MQTT Cover - Home Assistant
The error you see in your logs I also get but things had been working so I didnât investigate further. Based on the above linked documentation the error probably comes because I just pass the âStopâ directly from the hub This is the value set by the entry that state_topic points to. I donât want my system to be editing values because then for every device I have to release a new version. Its better to leave that up to the integration. My understanding of the documentation is that I can fill out state_closing, state_opening, and state_stopped with the values the hub sends (up, down, stop) and HASSIO is supposed to map that state_topic value itself. Now clearly this isnât happening, either I understand that documentation incorrectly or there is a bug in HASSIO and I should probably make a post here asking for developer support. If I understand it wrong then Iâll probably have to add a mapping function in the templates, so the values can be mapped in the config because like I said I donât want to hardcode values like that into the system.
A tip if youâre using MQTT. I like to use MQTT Explorer to look at exactly what is going on. You can see under homeassistant/cover/sf_* will be your devices and the config based on the template that I send to hassio. Then under smartfriends2mqtt you see the raw values that get sent. Those raw values are accessible to use in HASSIO as long as you define the template.
Thanks for your help. I can confirm that I can see position values in the JSON output of your add-on, but for some covers itâs missing there as well, so I suppose those motors do not support this feature as you mentioned.
For me personally itâs unfortunately also difficult to debug, since I am helping a friend in this case and I can only VPN into his HA installation and also do not know all the details of his hardware setup (like which motors are used). I only know that he didnât listen to my advice before he got those darn closed eco-system motors instead of just âdumbâ Schellenberg motors with an additional Zwave or Zigbee actuator, and that I can now try to fix his utterly borked setup, since all of a sudden he wants to control the shutters via regular GIRA wall switches (since the crappy Schellenberg wirless switches canât be mounted on a in-wall socket and also look terrible)
as for the âbusy stateâ of âup/down/stopâ - that seems to be not accurate, since some shutters are stuck in âupâ or âdownâ state but they are not moving at all. This is why I suspect some state updates the add-on notices are not correctly forwarded to MQTT.
Iâll try to do some debugging via MQTT explorer, but since I kinda lost interest in fixing my friends crap atm, it might take some time.
Hi everyone, i need also your help. Iâm new to Home Assistant and unfortunately I donât know that much about MQTT either. No matter what Iâve tried so far, I canât get a connection to my SmartFriendsBox. Only errors like âTimeOutâ, âBadGatewayâ or simply no devices are displayed.
I suspect my mistake is in the mqtt url?!? should I use the IP instead of homeassitant.local? what would it look like then? mqtt: // ip home assistant: port? so 192.168.178.189:1883? or which port should I enter? do I even need the entry in configuration.yaml, or should i delete it?
Many greetings
Daniel
Ok, as a new user, i can only upload one PicâŚ
configuration.yaml
mqtt:
broler://homeassistant.local
username: MQTT-User
Password: Test123
Log SFB adon with error
[s6-init] making user provided files available at /var/run/s6/etcâŚexited 0.
[s6-init] ensuring user provided files have correct permsâŚexited 0.
[fix-attrs.d] applying ownership & permissions fixesâŚ
[fix-attrs.d] done.
[cont-init.d] executing container initialization scriptsâŚ
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-10-31T09:46:09.386Z [SmartSocket] Constructor finished
2021-10-31T09:46:09.391Z [SmartSocket] Setup with socketOptions: {âtimeoutâ:10000,âminVersionâ:âTLSv1â,âhostâ:â192.168.178.136â,âportâ:4300,âcaâ:{âtypeâ:âBufferâ,âdataâ:[45,45,45,45,45,66,69,71,73,78âŚ
shortened
âŚ[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason âtimeoutâ.] {
code: âERR_UNHANDLED_REJECTIONâ
I have no idea what log or config you posted but it is not for an MQTT server or the Smart Friends Bridge add-on. If you want to use the Smart Friends Bridge add-on then you should first try the REST API to make sure it works, thatâs how you get your device information. Did you install the add-on using supervisor?