Replacement firmware for iSpindel (GravityMon)

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I've been trying different things out so I'll try and break it down. I'll wait to try anything more until I hear from you.

1) I've figured out that if I add the 4 lines above, the MQTT clears out. It's as if there's too many characters. I can add the two short lines but if I add one of the longer ones, it clears out and is saved as blank.

2) I tried with ONLY the 4 lines and nothing is auto-discovered in Home Assistant... meaning that it doesn't show as a "Device" in the MQTT integration with corresponding entities. They're there but they are orphans. It sees something and the logs look like this:

Code:
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process discovery payload {'name': 'GravityMon4_gravity', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_gravity/state', 'platform': 'mqtt'}
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor gravmon_f7d47a_gravity, sending update
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Got update for entity with hash: ('sensor', 'gravmon_f7d47a_gravity') '{'name': 'GravityMon4_gravity', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_gravity/state', 'platform': 'mqtt'}'
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: sensor.gravitymon4_gravity_2
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'gravmon_f7d47a_gravity'): deque([])
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on homeassistant/sensor/gravmon_f7d47a_rssi/config: b'{"name": "GravityMon4_rssi", "state_topic": "homeassistant/sensor/gravmon_f7d47a_rssi/state"}'
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process discovery payload {'name': 'GravityMon4_rssi', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_rssi/state', 'platform': 'mqtt'}
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor gravmon_f7d47a_rssi, sending update
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Got update for entity with hash: ('sensor', 'gravmon_f7d47a_rssi') '{'name': 'GravityMon4_rssi', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_rssi/state', 'platform': 'mqtt'}'
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: sensor.gravitymon4_rssi_2
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'gravmon_f7d47a_rssi'): deque([])
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on gravmon/GravityMon4/battery: b'4.03'
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on gravmon/GravityMon4/gravity: b'1.1298'





The error log shows errors from before. Nothing current but it's hard to tell because it doesn't show a timestamp.
With the mqtt discovery I posted they only show up as entities, not a device. This is from my HA installation and entities page where I searched for "gravmon". There are probably more attributes to set of it should show up as a device as well. Havent had time to play with it too much today,

1658900068937.png


If you use the function "gather support information" on the index page and post the following sections to me in a PM. Then I can check if this could be a memory problem or not and get a hint on what to change.

"formats": {
"id": "66a1b0",
"http-1": "",
"http-2": "",
"http-3": "",
"influxdb": "",
"mqtt": ""

"files": [
{
"file-name": "drd.dat",
"file-size": 4
},
{
"file-name": "error.log",
"file-size": 1163
},
{
"file-name": "gravitymon.json",
"file-size": 1105
}
 
Last edited:

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
With the mqtt discovery I posted they only show up as entities, not a device. This is from my HA installation and entities page where I searched for "gravmon". There are probably more attributes to set of it should show up as a device as well. Havent had time to play with it too much today,

View attachment 776044

There's no attachment.
 

gingerneil

Active Member
Joined
Aug 26, 2019
Messages
32
Reaction score
3
Thanks. I am using 6.5.1 as there still seemed to be a few bugs on 7.x - but the MQTT config can be a pain to setup. I'll have a go and test it. Cheers.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
Thanks. I am using 6.5.1 as there still seemed to be a few bugs on 7.x - but the MQTT config can be a pain to setup. I'll have a go and test it. Cheers.

I haven't tested it to see how it performs real world. I just liked the auto discovery. I tried looking at the code to see if it was something I could incorporate into GravMon but I'm just not that good with code. :ghostly:
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I haven't tested it to see how it performs real world. I just liked the auto discovery. I tried looking at the code to see if it was something I could incorporate into GravMon but I'm just not that good with code. :ghostly:
It should be possible to figure out the mqtt commands with the current firmware the. I can include it as a feature that can be enabled with a checkbox or something.

what sensor values would be of interrest to have in ha?
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
It should be possible to figure out the mqtt commands with the current firmware the. I can include it as a feature that can be enabled with a checkbox or something.

what sensor values would be of interrest to have in ha?

Well right now I have Battery Voltage, Gravity, Signal Strength, Temperature, and Tilt. I think those are just the defaults that iSpindel passes along to HA.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Well right now I have Battery Voltage, Gravity, Signal Strength, Temperature, and Tilt. I think those are just the defaults that iSpindel passes along to HA.
I've managed to get it to work but the current version cannot handle the large format template. Probably only 2 of the sensor values can be handled in v1.0. I will increase the memory allocation in the next version. This format template will register the device and two attributes, temp and gravity.

gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/gravity:${gravity}|
homeassistant/sensor/gravmon_${id}/temperature/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":"${id}"},"uniq_id":"${id}_temp","name":"temperature","dev_cla":"temperature","unit_of_meas":"${temp-unit}","stat_t":"gravmon/${mdns}/temperature"}|
homeassistant/sensor/gravmon_${id}/gravity/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":"${id}"},"uniq_id":"${id}_grav","name":"gravity","dev_cla":"temperature","unit_of_meas":" ${gravity-unit}","stat_t":"gravmon/${mdns}/gravity"}|

This is how it looks on my dev version with all the sensors;

1658957701136.png
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I've managed to get it to work but the current version cannot handle the large format template. Probably only 2 of the sensor values can be handled in v1.0. I will increase the memory allocation in the next version. This format template will register the device and two attributes, temp and gravity.

gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/gravity:${gravity}|
homeassistant/sensor/gravmon_${id}/temperature/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":"${id}"},"uniq_id":"${id}_temp","name":"temperature","dev_cla":"temperature","unit_of_meas":"${temp-unit}","stat_t":"gravmon/${mdns}/temperature"}|
homeassistant/sensor/gravmon_${id}/gravity/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":"${id}"},"uniq_id":"${id}_grav","name":"gravity","dev_cla":"temperature","unit_of_meas":" ${gravity-unit}","stat_t":"gravmon/${mdns}/gravity"}|

This is how it looks on my dev version with all the sensors;

View attachment 776130
That's awesome!!!
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I've been trying different things out so I'll try and break it down. I'll wait to try anything more until I hear from you.

1) I've figured out that if I add the 4 lines above, the MQTT clears out. It's as if there's too many characters. I can add the two short lines but if I add one of the longer ones, it clears out and is saved as blank.

2) I tried with ONLY the 4 lines and nothing is auto-discovered in Home Assistant... meaning that it doesn't show as a "Device" in the MQTT integration with corresponding entities. They're there but they are orphans. It sees something and the logs look like this:

Code:
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process discovery payload {'name': 'GravityMon4_gravity', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_gravity/state', 'platform': 'mqtt'}
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor gravmon_f7d47a_gravity, sending update
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Got update for entity with hash: ('sensor', 'gravmon_f7d47a_gravity') '{'name': 'GravityMon4_gravity', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_gravity/state', 'platform': 'mqtt'}'
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: sensor.gravitymon4_gravity_2
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'gravmon_f7d47a_gravity'): deque([])
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on homeassistant/sensor/gravmon_f7d47a_rssi/config: b'{"name": "GravityMon4_rssi", "state_topic": "homeassistant/sensor/gravmon_f7d47a_rssi/state"}'
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process discovery payload {'name': 'GravityMon4_rssi', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_rssi/state', 'platform': 'mqtt'}
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor gravmon_f7d47a_rssi, sending update
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Got update for entity with hash: ('sensor', 'gravmon_f7d47a_rssi') '{'name': 'GravityMon4_rssi', 'state_topic': 'homeassistant/sensor/gravmon_f7d47a_rssi/state', 'platform': 'mqtt'}'
2022-07-26 15:19:45 INFO (MainThread) [homeassistant.components.mqtt.mixins] Ignoring unchanged update for: sensor.gravitymon4_rssi_2
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'gravmon_f7d47a_rssi'): deque([])
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on gravmon/GravityMon4/battery: b'4.03'
2022-07-26 15:19:45 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on gravmon/GravityMon4/gravity: b'1.1298'





The error log shows errors from before. Nothing current but it's hard to tell because it doesn't show a timestamp.
I think I have been able to replicate the issue. The large format template is most likley saved but when it tries to send it back to the user interface the internal memory is not large enough so it fails on that part.

I will increase the buffer in the next version to have some more room.

A workaround today could be to set the formats you dont use to a smaller string to allow for more memory for the mqtt part. You need to have at least one character (like a dash or similar) since an empty string would only reset the format template to default.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I've come up with a workaround for now. As long as I don't restart HA, everything works fine. I don't know how to configure/code so that HA doesn't forget the entities after a restart. So, I copy and paste the following lines into the MQTT part and save it. As you already know, it saves it but shows a blank page. I wait for HA to receive the MQTT message and confirm that the entities are good.

Code:
homeassistant/sensor/gravmon_${id}/temperature/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_temp","name":"Temperature","dev_cla":"temperature","unit_of_meas":"°${temp-unit}","stat_t":"gravmon/${mdns}/temperature"}|
homeassistant/sensor/gravmon_${id}/tilt/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_tilt","name":"Tilt","stat_t":"gravmon/${mdns}/tilt"}|
homeassistant/sensor/gravmon_${id}/battery/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_battery","name":"Battery Voltage","dev_cla":"voltage","unit_of_meas":"V","stat_t":"gravmon/${mdns}/battery"}|
homeassistant/sensor/gravmon_${id}/gravity/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_grav","name":"Gravity","unit_of_meas":" SG","stat_t":"gravmon/${mdns}/gravity"}|
homeassistant/sensor/gravmon_${id}/rssi/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_rssi","name":"Signal Strength","dev_cla":"signal_strength","unit_of_meas":" dB","stat_t":"gravmon/${mdns}/rssi"}|

Once I see that all looks good, I go back to the MQTT section and enter the following commands and save. This time, as expected, they save and will show if refreshing or coming back to the page later. All will work just fine until a restart and I'd have to follow the process again.

Code:
gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/tilt:${angle}|
gravmon/${mdns}/battery:${battery}|
gravmon/${mdns}/gravity:${gravity}|
gravmon/${mdns}/rssi:${rssi}|

Thanks again for all your work on this, mper!!
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Thats a good
I've come up with a workaround for now. As long as I don't restart HA, everything works fine. I don't know how to configure/code so that HA doesn't forget the entities after a restart. So, I copy and paste the following lines into the MQTT part and save it. As you already know, it saves it but shows a blank page. I wait for HA to receive the MQTT message and confirm that the entities are good.

Code:
homeassistant/sensor/gravmon_${id}/temperature/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_temp","name":"Temperature","dev_cla":"temperature","unit_of_meas":"°${temp-unit}","stat_t":"gravmon/${mdns}/temperature"}|
homeassistant/sensor/gravmon_${id}/tilt/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_tilt","name":"Tilt","stat_t":"gravmon/${mdns}/tilt"}|
homeassistant/sensor/gravmon_${id}/battery/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_battery","name":"Battery Voltage","dev_cla":"voltage","unit_of_meas":"V","stat_t":"gravmon/${mdns}/battery"}|
homeassistant/sensor/gravmon_${id}/gravity/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_grav","name":"Gravity","unit_of_meas":" SG","stat_t":"gravmon/${mdns}/gravity"}|
homeassistant/sensor/gravmon_${id}/rssi/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"1.0.0","ids":["${id}"]},"uniq_id":"${id}_rssi","name":"Signal Strength","dev_cla":"signal_strength","unit_of_meas":" dB","stat_t":"gravmon/${mdns}/rssi"}|

Once I see that all looks good, I go back to the MQTT section and enter the following commands and save. This time, as expected, they save and will show if refreshing or coming back to the page later. All will work just fine until a restart and I'd have to follow the process again.

Code:
gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/tilt:${angle}|
gravmon/${mdns}/battery:${battery}|
gravmon/${mdns}/gravity:${gravity}|
gravmon/${mdns}/rssi:${rssi}|

Thanks again for all your work on this, mper!!
thats a good workaround for now. Good that you made it work. I will probably release a new 1.1 beta 2 with this fixed next week. My latest brew worked fine. I will post here as soon as that is done.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
Thats a good workaround for now. Good that you made it work. I will probably release a new 1.1 beta 2 with this fixed next week. My latest brew worked fine. I will post here as soon as that is done.

Well then you'll have a new release out long before I'll actually use this for a batch! LOL
 

wd16261

Well-Known Member
Joined
Aug 5, 2019
Messages
147
Reaction score
31
Location
Belgium
I am also looking forward to this new release, so as soon as it is available I will definitely test it immediately?
But this will probably be in sugar water first. :D
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I've publised a v1.1.0 beta 2 with all the known issues so far, it can be found here; Release v1.1.0 beta 2 · mp-se/gravitymon

You need to manually upload this via the web interface -> config -> hardware -> upload firmware.

I will do some more testing before its a public release. I've tested this on a brew so I know it works, I just need to test and validate all the new features.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I've publised a v1.1.0 beta 2 with all the known issues so far, it can be found here; Release v1.1.0 beta 2 · mp-se/gravitymon

You need to manually upload this via the web interface -> config -> hardware -> upload firmware.

I will do some more testing before its a public release. I've tested this on a brew so I know it works, I just need to test and validate all the new features.

Working like a champ!!!
 

wd16261

Well-Known Member
Joined
Aug 5, 2019
Messages
147
Reaction score
31
Location
Belgium
I had to do a power Off/On to get it working after the firmware update but it looks very good :thumbsup:
 

wd16261

Well-Known Member
Joined
Aug 5, 2019
Messages
147
Reaction score
31
Location
Belgium
Some extra info. After the firmware was uploaded I received the message that it was completed:
1659292573470.png

I waited 10 sec. but the web page could not be displayed.
I tried to upload the firmware a second time and this time I've waited a bit longer, I think more then 30 seconds and then it worked well so maybe the text message needs to be adapted?
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I ended up making a few changes. I changed the "dev-cla" of battery to "voltage" and rssi to "signal_strength". I removed it and unit of measure from tilt. I also created a new one so I could see the current software version by adding

Code:
homeassistant/sensor/gravmon_${id}/swver/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"${app-ver}","ids":["${id}"]},"uniq_id":"${id}_swver","name":"Software Version","stat_t":"gravmon/${mdns}/swver"}|
gravmon/${mdns}/swver:${app-ver}

However, doing so must've put the MQTT code over the length limit again because it wouldn't work with all of it in the format editor section. I ended up having to break down the config statements, entered them in two separate instances, and did a test post to get it to send the info to HA. Once done, I removed the config section and added back just the 6 that send updates only. Working fine but, again, if I reboot HA, I'd have to go through it all again. Is there a way to code in the config statements so they only get sent to HA once?
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Some extra info. After the firmware was uploaded I received the message that it was completed:
View attachment 776471
I waited 10 sec. but the web page could not be displayed.
I tried to upload the firmware a second time and this time I've waited a bit longer, I think more then 30 seconds and then it worked well so maybe the text message needs to be adapted?
You have found an issue here... It looks like the device requires a hard reset to work after firmware upload. It fails on the gyro init after the reboot and goes into wifi mode due to a crash.

I've verfied that this problem also occurs with older version, but its tricky to find the cause...
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I ended up making a few changes. I changed the "dev-cla" of battery to "voltage" and rssi to "signal_strength". I removed it and unit of measure from tilt. I also created a new one so I could see the current software version by adding

Code:
homeassistant/sensor/gravmon_${id}/swver/config:{"dev":{"name":"${mdns}","mdl":"gravmon","sw":"${app-ver}","ids":["${id}"]},"uniq_id":"${id}_swver","name":"Software Version","stat_t":"gravmon/${mdns}/swver"}|
gravmon/${mdns}/swver:${app-ver}

However, doing so must've put the MQTT code over the length limit again because it wouldn't work with all of it in the format editor section. I ended up having to break down the config statements, entered them in two separate instances, and did a test post to get it to send the info to HA. Once done, I removed the config section and added back just the 6 that send updates only. Working fine but, again, if I reboot HA, I'd have to go through it all again. Is there a way to code in the config statements so they only get sent to HA once?
Thats good input, you have probably gone over the new buffer limit with those changes. There is not that much memory on the device so I might need to rewrite that part in another way to allow for larger payloads.

I will see if I can make the HA device registration smoother in some way. It's quite bulky as it is now. One option could be to split the data setup and device registration (and add unregister as well). As I understand you only need to do the device registration once.

Another issue is probably that this will not work if you have SSL to HA, it's likley that the device will crash.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
Thats good input, you have probably gone over the new buffer limit with those changes. There is not that much memory on the device so I might need to rewrite that part in another way to allow for larger payloads.

I will see if I can make the HA device registration smoother in some way. It's quite bulky as it is now. One option could be to split the data setup and device registration (and add unregister as well). As I understand you only need to do the device registration once.

Another issue is probably that this will not work if you have SSL to HA, it's likley that the device will crash.

When I looked at the HA logs, it appears that iSpindel will register the device and then subscribe to it. The next message that comes in is just the data message. I hope I'm explaining this correctly, I don't know very much about MQTT.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
When I looked at the HA logs, it appears that iSpindel will register the device and then subscribe to it. The next message that comes in is just the data message. I hope I'm explaining this correctly, I don't know very much about MQTT.
Its the same approach that I was thinking of, separate the registration and data transmission. That would require some larger changes to the code to handle that part. Its easy when you have a fixed set of data points to handle but in this software the user has a lot of options to customize which makes it more difficult.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Its the same approach that I was thinking of, separate the registration and data transmission. That would require some larger changes to the code to handle that part. Its easy when you have a fixed set of data points to handle but in this software the user has a lot of options to customize which makes it more difficult.
I decided not to do any big changes to the structure to handle the HA registration. Using what I have implemented the device registration will be executed when saving the format template and during gravity operation it will only send the data and skip the registration entities.

I've also rewritten the format APIs to conserve memory which would be able to handle larger format templates.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I've just publised a v1.1.0 beta3 with some bug fixes and changes that have been suggested here. Thanks for the feedback.
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I've just publised a v1.1.0 beta3 with some bug fixes and changes that have been suggested here. Thanks for the feedback.

Doesn't seem to be working for me. I flashed one of my units, deleted it from HA, did an MQTT test send and HA doesn't report receiving anything. I've rebooted both with no luck.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Doesn't seem to be working for me. I flashed one of my units, deleted it from HA, did an MQTT test send and HA doesn't report receiving anything. I've rebooted both with no luck.
Try this approach.

Open the format editor, Select MQTT as format template, Ensure that you have homeassistant device registration entries in the template. Press save.

You will first get this message at the top of the page:
"Home Assistant device configuration detected in MQTT format. These messages will be posted when format is saved and not during gravity measurement."

The device will first save the format template, and then post the messages to mqtt. The device should then appear in HA.

You will get these messages at the top of the page.
"Format stored successfully.."

And then it should change to:
"Format stored successfully. Home Assistant Device Registration Successful."
 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
Try this approach.

Open the format editor, Select MQTT as format template, Ensure that you have homeassistant device registration entries in the template. Press save.

You will first get this message at the top of the page:
"Home Assistant device configuration detected in MQTT format. These messages will be posted when format is saved and not during gravity measurement."

The device will first save the format template, and then post the messages to mqtt. The device should then appear in HA.

You will get these messages at the top of the page.
"Format stored successfully.."

And then it should change to:
"Format stored successfully. Home Assistant Device Registration Successful."

Everything worked up until the successful device registration. I got "Format stored successfully. Home Assistant Device Registration Failed!"

I then tried entering the config statements one at a time. It kept working until I got to the last one and it errored out. I deleted everything except for that last one I added and it worked. Deleted that line and added back the lines for the measurments. Works fine. So, it appears to be an issue that there's too many characters if I enter all 6 config lines at the same time.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
Everything worked up until the successful device registration. I got "Format stored successfully. Home Assistant Device Registration Failed!"

I then tried entering the config statements one at a time. It kept working until I got to the last one and it errored out. I deleted everything except for that last one I added and it worked. Deleted that line and added back the lines for the measurments. Works fine. So, it appears to be an issue that there's too many characters if I enter all 6 config lines at the same time.
Send me your config in a PM and I will use that to test and see what the problem is.
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I've just release v1.1 with some new features and improvements from this thread. Thanks very much for feedback and great suggestions. It's also published in brewflasher. If you already have the firmware installed, it can be installed from the web interface via config->hardware->upload.

 

BigHefty

Supporting Member
HBT Supporter
Joined
Dec 26, 2009
Messages
185
Reaction score
7
Location
Montrose, MI
I've just release v1.1 with some new features and improvements from this thread. Thanks very much for feedback and great suggestions. It's also published in brewflasher. If you already have the firmware installed, it can be installed from the web interface via config->hardware->upload.

Upgraded and working fine.
 

engltayl

New Member
Joined
Sep 10, 2022
Messages
3
Reaction score
0
Location
uk
I am trying to use gravitymon with either brewspy or brewfather. When i test the push service i get the following error. I am using a ispindel which ive had working previously with the default firmware.

Push target 'http-1' failed with error code -11

Any ideas?

Thanks

Lee
 
OP
OP
M

mper

Supporting Member
HBT Supporter
Joined
May 24, 2020
Messages
100
Reaction score
32
I am trying to use gravitymon with either brewspy or brewfather. When i test the push service i get the following error. I am using a ispindel which ive had working previously with the default firmware.

Push target 'http-1' failed with error code -11

Any ideas?

Thanks

Lee
You have the error codes here; Troubleshooting - GravityMon 1.1.0 documentation

-11 means timeout so the remote server is not responding fast enough (http read timeout). If I remember correctly the default timeout should be 10 seconds, this should be enough for most services. It's not an error that normally would show up. Apparently the connection to the remote server is successful but it cannot read any response. Could be some issue with the remote server, configuration or your local network.

Can you share your configuration ? Please remove (or change) any sensitive parts (tokens or similar).

Which brewfather endpoint are you using ? There are two differnt to chose from.
 

DuncB

Well-Known Member
Joined
Jun 5, 2019
Messages
2,552
Reaction score
1,472
Location
Paremata New Zealand
You have the error codes here; Troubleshooting - GravityMon 1.1.0 documentation

-11 means timeout so the remote server is not responding fast enough (http read timeout). If I remember correctly the default timeout should be 10 seconds, this should be enough for most services. It's not an error that normally would show up. Apparently the connection to the remote server is successful but it cannot read any response. Could be some issue with the remote server, configuration or your local network.

Can you share your configuration ? Please remove (or change) any sensitive parts (tokens or similar).

Which brewfather endpoint are you using ? There are two differnt to chose from.
I'd reach out to brewspy, really quick responder. Sorted out my issue very quickly.
 
Top