Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for propane level sensor (iGrillv3) #9

Closed
eth0up opened this issue Aug 13, 2021 · 21 comments
Closed

Add support for propane level sensor (iGrillv3) #9

eth0up opened this issue Aug 13, 2021 · 21 comments
Assignees
Labels
enhancement New feature or request

Comments

@eth0up
Copy link
Contributor

eth0up commented Aug 13, 2021

My iGrillv3 is equipped with a propane level sensor. The official iGrill app reports the propane level. I'm submitting this issue as a feature request to see the same level reporting functionality within esp32_iGrill.

  • Propane Level sensor's BLEUUID is f5d40001-3548-4c22-9947-f3673fce3cd9s
  • Propane Level sensor has 5 possible values: 100, 75, 50, 25, or 0
  • (Python) the maths used to format the reported level's value: float(bytearray(self.propane_level.read())[0])*25
  • Implementation in Python, for reference: bendikwa/igrill@e6522bf
@1mckenna 1mckenna self-assigned this Aug 13, 2021
@1mckenna 1mckenna added the enhancement New feature or request label Aug 13, 2021
@1mckenna
Copy link
Owner

I just pushed an updated version to the propane branch that should work (or be close). Can you switch to that branch and then try that version and let me know the results.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 14, 2021

I just pushed an updated version to the propane branch that should work (or be close). Can you switch to that branch and then try that version and let me know the results.

Line #288 in esp32_iGrill.ino needs a trailing semicolon for successful compilation in Arduino IDE:

has_propane_sensor=false

I uploaded the propane branch sketch to my esp32, but unfortunately I'm not seeing a propane sensor within Home Assistant or MQTT Explorer. I'm attempting to revive my laptop so that I can view the esp logs while being simultaneously within bluetooth range of the igrill (the desktop pc I'm using is not within bt range) . Hopefully the debug output while connected gives us some hints for needed changes. It might be worth noting that my propane tank is currently less than 25% full, so the reported value would be expected as "0".

Thanks for getting started on this enhancement so swiftly!

@1mckenna
Copy link
Owner

I made a small update to show if a propane sensor was setup in the systeminfo mqtt topic. Can you try the latest and let me know if in MQTT its showing propane sensor as true or false.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 15, 2021

I made a small update to show if a propane sensor was setup in the systeminfo mqtt topic. Can you try the latest and let me know if in MQTT its showing propane sensor as true or false.

MQTT is showing the following for propane sensor:
"Propane Sensor": "0"

I'm on software:
"sw_version": "1.10-000"

@1mckenna
Copy link
Owner

Looks like it's not detecting that characteristic.

Can you perform the steps below and attach a screenshot of the output here.

  1. Install the Weber iGrill App and pair the device to the phone via the app
  2. Install the nrfConnect Android App
  3. Once in the App Click on the Bonded Tab
  4. You should see your iGrill listed, click Connect
  5. It should then go through discovery of the services
  6. In the listed services can you find the one related to propane level and take a screenshot/attach all the details shown.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 18, 2021

Here's what I've got from the nrfConnect app:
nrfConnect_igrill_propane

Value 0x030000 matches up with 75% fuel level as identified on this git comment:
bendikwa/igrill#12 (comment)

Let me know whether there's anything else you'd like me to test. Thanks!

@1mckenna
Copy link
Owner

Looks like the propane level is on its own service uuid which is why we weren't able to read that characteristic. I just pushed changes that hopefully should get us some values back. When you get a bit of free time can you pull the latest code and let me know the results.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 19, 2021

I synced with latest, unfortunately I'm still not seeing the propane sensor in Home Assistant. MQTT Explorer reports "Propane Sensor": "0".

To double check, I connected via the Weber iGrill App and confirmed that propane level displays as expected:
weberapp_igrill_propane

@1mckenna
Copy link
Owner

Oops realized after you replied that I forgot to change the UUID for the Propane service when I made the updates. Can you re-pull and try again.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 19, 2021

Oops realized after you replied that I forgot to change the UUID for the Propane service when I made the updates. Can you re-pull and try again.

MQTT Explorer reports "Propane Sensor": "0" after applying the latest change. I confirmed that the app is still displaying the propane level.

@1mckenna
Copy link
Owner

Just to confirm you unpaired your phone from the iGrill before testing?

In your latest test is it still reporting the temps to mqtt?

Did you happen to get your laptop running so we can get the debug logs for a closer look at what's happening? If not I'll need to make some updates to throw the debug logs to mqtt.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 20, 2021

Just to confirm you unpaired your phone from the iGrill before testing?

In your latest test is it still reporting the temps to mqtt?

Did you happen to get your laptop running so we can get the debug logs for a closer look at what's happening? If not I'll need to make some updates to throw the debug logs to mqtt.

I did unpair from my phone before re-testing with esp32. In latest, I was still seeing temperatures and battery reported to MQTT. I also tried forcing has_propane_sensor=true but did not see any MQTT output related to propane sensor.

I just finished getting my laptop up and running and confirmed that I can see the serial monitor output from esp32 as it runs iGrill code.

@1mckenna
Copy link
Owner

I just changed how the code is trying to detect if the propane service exists and added in some additional logging. Can you try pulling the most recent and then let me know if its showing in the Serial logs if it detects the propane service or not.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 23, 2021

After pulling latest the serial logs show that the esp32 successfully connects to the propane service and accurately displays the propane level value - very awesome!
image

I'm also seeing messages in MQTT Explorer reporting the propane_level.

@1mckenna
Copy link
Owner

Awesome!! Are you also running Home Assistant? If so after a restart of HA did the propane level sensor show up properly there too?

@eth0up
Copy link
Contributor Author

eth0up commented Aug 23, 2021

Awesome!! Are you also running Home Assistant? If so after a restart of HA did the propane level sensor show up properly there too?

I am running HA, but the propane sensor does not show up under the igrill device or in the entities. I noticed that the MQTT messages for Battery and Probe (which both show up in HA as sensors under the igrill device) are formatted differently than the propane_level:
image

While propane level is accurately reported in the serial output, it seems that the same value isn't being sent via MQTT.

@1mckenna
Copy link
Owner

I just pushed an update that should hopefully fix that issue. You'll likely need to delete the topics via MQTT explorer for things to show up properly. Then if all looks well in MQTT Explorer a restart of HA should get the propane level sensor discovered.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 23, 2021

After latest update, a propane sensor shows up under the igrill device in HA! The value was reported as "3%", which led me to believe the code for reporting value was missing a multiplication operation.

On my local copy I found and changed Line#391 from publishPropaneLevel(value); to publishPropaneLevel(value*25); and re-uploaded to the esp32. After this small change Home Assistant now reports a propane sensor with value of 75, which matches my current propane level.

@1mckenna
Copy link
Owner

Thank you! I just fixed and pushed that change. If everything else is working well I'll go ahead and push this to the main branch.

@eth0up
Copy link
Contributor Author

eth0up commented Aug 23, 2021

Thank you! I just fixed and pushed that change. If everything else is working well I'll go ahead and push this to the main branch.

For good measure I pulled latest and uploaded to the esp32 - it's working very well! Thanks for spending your time and effort to get this feature added.

@1mckenna
Copy link
Owner

I just merged this into the main branch and added you to the contributions section in the readme. Thanks again for the help getting this working and tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants