Writing platform where sensors have variable names

I’m beginning to wonder if I’m trying to fit a square peg in a round hole.

I’m writing a platform (should probably be a component and platform) for my Heatermeter which is a BBQ Pit controller. I’m having no problems interfacing with the Heatermeter and getting “sensor” data back in to HA. Additionally, I’m able to set things like the pit temperature, etc.

My problem is that I’d like the flexibility of being able to rename meat probes and not have to use customize.yaml or restart HM. Ideally, I’d be able to rename the meat probe in HA and have that persist.

For example, the Heatermeter has a pit probe and up to 3 meat probes, say pit_probe, meat_probe1, meat_probe2, meat_probe3. I’d like HM to have the entity name of pit_probe, meat_probe1, etc but be able to display in HA something like:
meat_probe1 = brisket
meat_probe2 = chicken

I know I can use customize.yaml with friendly_name but that will require a config change every time I cook something different. I’m hoping for something more dynamic.

I added a probe_name attribute in hopes that I could do something like this in the customize.yaml file but this does not work

sensor.hm_probe1:
  friendly_name: "{{ sensor.hm_probe1.attributes.probe_name }}"

Hopefully I haven’t rambled too much :slight_smile:

Any ideas?

Thanks!

I don’t think you can dynamically change names of groups / entities. You might try stacking the information so the name is above the temp for each probe. Alternatively, you can have a message such as in the dev-template that formats the text how you want.

Admittedly, I haven’t delved too much into templates/Jinja as it makes my head hurt. Python code, Appdaemon I’m good with. Jinja templates… sigh.

If I understand correctly, I should be able to craft together a card using templates/Jinja that shows the various probe values but uses the probe_name attribute I set in the Entity? Thinking out loud, I should also be able to put various inputs in the card like changing pit temperature or PID values as well.

Ultimately, I’d like to bring this info into HADashboard but I’ll tackle that once I get things situated in HA.

Why not do it in AD with the new HADashboard that’s being tested. I’m wondering if you setup a sensor where the state of the sensor is the meat probe name, then with the Dashboard, you can position them so they display close together and make it look like they are the same widget. Maybe??

I’ve got a CyberQ that I’ve been delaying working on the same way. Might have to give that a try now. What are you cooking?

If you don’t want to use a card, perhaps you could put all the info you want into a sensor template and then show that sensor state in your dashboard.

sensor:
  - platform: template
    sensors:
      whats_cooking:
        value_template: '{{ sensor.hm_probe1.attributes.probe_name } is at temperature { sensor.hm_probe1.attributes.temp }}'

Ahh… Another BBQer! I was wondering if there were any HA users that also smoked/bbqed.

At some point I am going to move over to HADashboard as I really like that interface - especially for something like this. If I have to, I’ll go the route of hiding/positioning but in my experience that tends to be brittle in that a day, week or months down the line, something will change in HAD and then the “nice” looking dashboard will not be so nice looking.

If your interested, I could write the basics of a pit controller component which you could then utilize for writing a CyberQ platform. I was thinking about making a pit controller component anyways.

See – this is what happens when I jump in the deep end of the pool; I don’t realize some of the other nuances like sensor templates. I’ll try this and see what happens.

I do prefer for the value/probe_name to be in a proper looking card. I’ll fiddle around using a sensor template.

Hi, did you ever progress with this?

yea i have the same question!! i would love to have a couple of sensors who read my cyber bbq controller.

it looks like somebody already did some ground work but i have no idea how to get this into HA

https://cyberqinterface.readthedocs.io/en/latest/index.html