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?
That’s not this one. That guy never responds to anything, I tried contributing to his but he ignores it… That’s why I wrote my own and made it actually work. If you install this one I can help you if you’re having problems. hassio-addons/smartfriends-bridge at main · GimpArm/hassio-addons · GitHub
I’ve just started with the SmartFriends Rest API. Set it up and try the link: http: // homeassistant: 5001 / list -great, it works
4 weeks ago I started with homeassistant, that was my first project that made me desperate. But now it worked.
i stoped this Addon and installed "control your SmartFreinds devices through REST or MQTT.
try the link: it also work!
now I’m not getting any further. I thought that my MQTT broker would find the devices if everything is configured. But now I read, I have to enter the devices in “deviceMap.json” and “DataPath”.
Where can i find it?
Unfortunately, as a beginner, I can’t do anything with these terms.
I am currently missing the transition to control the devices, or to make them visible in homeassistant
i hope you can understand what i mean
Have a nice evening
The DataPath is where your configure.yaml file is located. After enabling MQTT and starting there should be a smartfriends2mqtt folder there. Inside that you can set which devices you want to pass to MQTT by giving their device id and what Type of device it is. Class is optional but helps for a little more detail. Get your list of types and classes in the HASSIO documentation. MQTT Discovery - Home Assistant
Hi GimpArm,
thanks for your Add-on!
The REST-API works fine for me, but I cannot run the MQTT-Interface.
I run a MQTT-Server out of Home Assistant, can that be a problem?
My config look like this:
First, is it connecting but just not showing your devices or are you seeing connection errors in your log?
I suspect it isn’t connecting. Do not include “mqtt://” for the server, just give it the name. I would also make sure that is really the correct IP. Since add-ons run as docker containers on a virtual network, usually it is best to not use an IP and instead a domain name. I think the default name is hassio.local