adityapattiyeri / home-remote

An EspHome based remote control for Home Assistant
Apache License 2.0
74 stars 1 forks source link

Could you please elaborate on the code within HA that you use? #1

Closed emefff closed 2 years ago

emefff commented 2 years ago

Hello, first of all: this is a great project, which I wanted to do for a long time. I was sure, I would not have been able to do that without some input from someone who is a better programmer than me :-). However, I just built the hardware part, but I am struggling with the software. I would be very much interested in what is needed in HA for this to work. For example: what is input_select.scenes? Is it a data_template or a text_sensor? Same holds for input_select.select_next, is it a custom service call? I am really stuck at the moment, I am sure I am missing something... I'd apprecitate any hints, thank you, Mario.

adityapattiyeri commented 2 years ago

Hi,

It is wonderful to hear that you're trying out my project! I have edited the code and read me, hope it clarifies your questions.

emefff commented 2 years ago

Hello, thanks a lot for answering. I will have a look on that today. My 'Home' page works at the moment, also with changing icons for wifi and battery. But I am not able to access the other pages because 'scene' is unknown. I am sure my HA does not know somehow what input_select.scenes is. Can you show what input_select.scenes in your HA looks like (mine does not have any entity like this)?

To give something back to this great project: For battery and wifi measurement you'll need two more sensors like:

sensor:

So there you have the two values you need. For the battery measurement you'll need a voltage divider to your ADC pin (here: 34, the last pins are inputs only so they are ideal for that, you don't want to waste a full IO pin for that; remember you have a 3.3V logic and a max. 4.2V battery)

On the homepage I added (dont forget the icon-'library' under font):

       //wifi
      //it.printf(4, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F046B");

      if ((id(remote_wifi_signal).state >= -50)) {
      it.printf(1, -2, id(wifi_battery_font),TextAlign::TOP_LEFT, "\U000F0928");}
      else if ((id(remote_wifi_signal).state >= -60) and (id(remote_wifi_signal).state < -50)) {
      it.printf(1, -2, id(wifi_battery_font),TextAlign::TOP_LEFT, "\U000F0925");}
      else if ((id(remote_wifi_signal).state >= -70) and (id(remote_wifi_signal).state < -60)) {
      it.printf(1, -2, id(wifi_battery_font),TextAlign::TOP_LEFT, "\U000F0922");}
      else if ((id(remote_wifi_signal).state < -70)) {
      it.printf(1, -2, id(wifi_battery_font),TextAlign::TOP_LEFT, "\U000F091F");}

      //it.printf(14, 0, id(media_title_font_mini), TextAlign::TOP_LEFT , "%.0fdBm", id(remote_wifi_signal).state);

      //battery
      //it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F12A1");

      if ((id(remote_battery_voltage).state >= 4.18)) {
      it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F008F");}
      if ((id(remote_battery_voltage).state >= 4.0) and (id(remote_battery_voltage).state < 4.18)) {
      it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F0081");}
      else if ((id(remote_battery_voltage).state >= 3.75) and (id(remote_battery_voltage).state < 4.0)) {
      it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F007F");}
      else if ((id(remote_battery_voltage).state >= 3.5) and (id(remote_battery_voltage).state < 3.75)) {
      it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F007D");}
      else if ((id(remote_battery_voltage).state < 3.5)) {
      it.printf(124, 0, id(wifi_battery_font),TextAlign::TOP_CENTER, "\U000F007B");}

      it.printf(120, 0, id(media_title_font_mini), TextAlign::TOP_RIGHT , "%.1fV", id(remote_battery_voltage).state);

So there's that, thank you

greetings,

Mario.

adityapattiyeri commented 2 years ago

Hi Mario,

Thanks, I will definitely be adding it to a future release. I am closing this issue as well.