Raspberry Pi 4 Model B temperature

Thanks. I used the process proposed by regystro:

This brought the integration to 0.2.0 and it works. So, if you want to upgrade to 0.2.0, it appears to be a working process.

Could you post the steps? seems that link gets the good ol 404 now.

I had to manually download the zip and extract the files into

image

config.yaml

binary_sensor:
  
  #=======================
  #=== Raspberry Pi Power
  #=======================

  - platform: rpi_power

I used HACS to install it, maybe that’s my problem. I set it up as a binary sensor but still got that error.

I’ll try manually downloading the files and moving them over.

1 Like

I am getting the error afer I set this up using HACS

Platform error binary_sensor.rpi_power - No module named 'custom_components.rpi_power.binary_sensor'

When i check the configuration and I am reasonably sure that I have the files in the right place, the yaml references from above etc.

Any other thoughts?

Still the same here as well … Entity not available: binary_sensor.rpi_power_status
I reverted back last month. Now tried again. Still not working.
Uploaded with HACS seems to be the breaking issue …
I remember there was a discussion with the developers mentioning this was done to migrate it into HA. But I cannot find back this discussion anymore.

So need to revert back to the previous version again …

Hi,

I have not installed via HACS, All I did is download the zip archive from the Github page, extract and copy the
folder custom_components/rpi_power to


image
image

My updated YAML code.

sensor:

#==================
#=== System Sensors
#==================

  - platform: command_line
    name: RPi CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    value_template: "{{ value | multiply(0.001) | round(2) }}"

  #===========================================
  #=== Latest Tasmota firmware version
  #===========================================

  - platform: command_line
    name: Tasmota Current Version
    command: "curl -s https://github.com/arendst/Tasmota/releases/latest | cut -d'\"' -f2 | rev | cut -d'/' -f1 | rev"
    scan_interval: 86400

  #==============================
  #=== Installed hass.io version
  #==============================

  - platform: version
    name: Installed Version
    source: local


  #================================
  #=== Latest Available HA Version
  #================================

  - platform: version
    name: Latest Available Version
    beta: false
    image: raspberrypi4
    source: hassio


  #=============================================
  #=== Last boot time, Disk, memory & CPU usage
  #=============================================

  - platform: systemmonitor
    resources:
      - type: last_boot
      - type: disk_use_percent
        arg: /
      - type: memory_use_percent
      - type: processor_use


  #===================
  #=== System Up Time
  #===================

  - platform: uptime

  - platform: template
    sensors:

      #==========================
      #=== Home Assistant uptime
      #==========================

      ha_uptime:
        friendly_name: HA Uptime
        value_template: >
          {% if states('sensor.uptime') == '0.0' %} 
            Just restarted...
          {% else %}
            {% macro phrase(value, name) %}
            {%- set value = value | int %}
            {%- set end = 's' if value > 1 else '' %}
            {{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
            {%- endmacro %}
            
            {% set weeks = (states('sensor.uptime') | int / 7) | int %}
            {% set days = (states('sensor.uptime') | int) - (weeks * 7) %}
            {% set hours = (states('sensor.uptime') | float - states('sensor.uptime') | int) * 24 %}
            {% set minutes = (hours - hours | int) * 60 %}

            {{ [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min') ] | select('!=','') | list | join(', ') }}
          {% endif %}

      #=========================================
      #=== Raspberry Pi last boot date and time
      #=========================================

      last_boot_date_time:
        friendly_name: Last Boot
        value_template: >
          {% set date = as_timestamp(states('sensor.last_boot')) | timestamp_custom('%d') %}
          {% set date = '{:01}'.format(date | int) %}
          {% if date in ('1', '21', '31') %}
            {% set date = date ~ 'st' %}
          {% elif date in ('2', '22') %}
            {% set date = date ~ 'nd' %}
          {% elif date in ('3', '23') %}
            {% set date = date ~ 'rd' %}
          {% else %}
            {% set date = date ~ 'th' %}
          {% endif %}

          {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%H:%M on %a') }} {{ date }} {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%b %Y') }}

      #=========================
      #=== Raspberry Pi Up Time
      #=========================

      rpi_uptime:
        friendly_name: RPi Uptime
#        entity_id: sensor.time
        value_template: >
          {% set up_time = as_timestamp(now()) - as_timestamp(states('sensor.last_boot')) %}

          {% set minutes = (up_time // 60) | int %}
          {% set hours = (minutes // 60) %}
          {% set days = (hours // 24) %}
          {% set weeks = (days // 7) %}

          {% set minutes = (minutes % 60) %}
          {% set hours =  (hours % 24) %}
          {% set days = (days % 7) %}

          {% macro phrase(value, name) %}
                    {%- set value = value %}
                    {%- set end = 's' if value > 1 else '' %}
                    {{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
          {%- endmacro %}
                    
          {% set text = [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min') ] | select('!=','') | list | join(', ') %}
          {% set last_comma = text.rfind(',') %}
          {% if last_comma != -1 %}
            {% set text = text[:last_comma] + ' and' + text[last_comma + 1:] %}
          {% endif %}
          
          {{ text }}

    
### BINARY SENSOR  ###

binary_sensor:

  #=======================
  #=== Raspberry Pi Power
  #=======================

  - platform: rpi_power

image

Yeah. Looks like the author @swetoast broke it for 0.2.0 version and when people complained he told us, that he is not going to fix it as this is the last version which he is now integrating into HA (in this broken state).
And as probably more people complained about such move, he went on and disabled “Issues” section on Github. Fine chap, isn’t he? :wink:

2 Likes

It works if you install it as I mentioned above, don’t install with HACS use manual method.

A tad unfair to the author in my opinion…

Maybe. It is his creation, so he has full right to also break it. That’s true.

But why disabling “Issues” section in the repo?
Even if he has no intention to help people to make that broken version working, there are others that provided hints and guides how to make it work. And having it right there in the repo would be much better than here in the forum.

Hi , :wave:
What is the difference between these integrations ?
1- https://www.home-assistant.io/integrations/rpi_power/

And

2- https://github.com/custom-components/sensor.rpi_power

It should be under binary_sensor section. See:

 binary_sensor:
   - platform: rpi_power
     text_state: True

I think I installed everything the right way, but…

2021-04-11 09:57:27 ERROR (MainThread) [homeassistant.config_entries] Error importing platform config_flow from integration rpi_power to set up rpi_power configuration entry: No module named 'custom_components.rpi_power.const'
2021-04-11 09:57:27 WARNING (MainThread) [custom_components.ble_monitor] Available Bluetooth interfaces for BLE monitor: ['DC:A6:32:FC:B3:AC']
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.command_line.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.command_line.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.version.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.version.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.rpi_power.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.systemmonitor.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.command_line.tts'
2021-04-11 09:57:29 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.uptime.tts'
2021-04-11 09:57:31 ERROR (MainThread) [homeassistant.config] Platform error: tts
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 847, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'homeassistant.components.template.tts'

Could someone help me?

Hello,

Is this configuration still valid? I am getting configuration file errors when trying to copy this into my HA configuration file?

What are you pasting in where, and what errors are you getting? If you want help, you need to provide more information than this…

Very good, thank guy

Hijacking the thread to report my results from switching from no case to the FLIRC RPi4 case.

Went from ~64C to ~50C :beers:

In my Argon One M.2 case the temperature is normally at 37C.

@MarkB1 could you share your latest configuration with actual version of HA?
I want to create similar sensor, but from beginning I got only errors in HA…

Hi,

I have since migrated to a NUC.

#==================
#=== System Sensors
#==================

  
  
  #===========================================
  #=== NUC CPU TEMPERATURE
  #===========================================

    
  - platform: command_line
    name: CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone2/temp"
    unit_of_measurement: "°C"
    scan_interval: 240
    value_template: '{{ value | multiply(0.001) | round(1) }}'    
   
  #===========================================
  #=== Latest Tasmota firmware version
  #===========================================

  - platform: command_line
    name: Tasmota Current Version
    command: "curl -s https://github.com/arendst/Tasmota/releases/latest | cut -d'\"' -f2 | rev | cut -d'/' -f1 | rev"
    scan_interval: 86400


  #=============================================
  #=== Last boot time, Disk, memory & CPU usage
  #=============================================

  - platform: systemmonitor
    resources:
      - type: last_boot
      - type: disk_use_percent
        arg: /
      - type: memory_use_percent
      - type: processor_use


  #==========================
  #=== Home Assistant uptime
  #==========================

  - platform: template
    sensors:
      homeassistant_uptime:
          friendly_name: HomeAssistant Uptime
          value_template: >-
            {% set up_time = as_timestamp(now())-as_timestamp(states('sensor.uptime')) %}
            {% set minutes = (up_time // 60)|int %}
            {% set hours = minutes // 60 %}
            {% set days = hours // 24 %}

            {% set minutes = minutes % 60 %}
            {% set hours =  hours % 24 %}
            {% set days = days % 7 %}

            {% macro phrase(value,name) %}
              {%- set value = value %}
              {%- set end = 's' if value > 1 else '' %}
              {{- '{} {}{}'.format(value,name,end) if value|int > 0 else '' }}
            {%- endmacro %}

            {% set text = [phrase(days,'day'),phrase(hours,'hour'),
                           phrase(minutes,'min')]
                           |select('!=','')|list|join(', ') %}
            {% set last_comma = text.rfind(',') %}
            {% if last_comma != -1 %}
              {% set text = text[:last_comma] + ' and' + text[last_comma + 1:] %}
            {% endif %}

            {{text}}

      #=========================================
      #=== Last boot date and time =============
      #=========================================

      last_boot_date_time:
        friendly_name: Last Boot
        value_template: >
          {% set date = as_timestamp(states('sensor.last_boot')) | timestamp_custom('%d') %}
          {% set date = '{:01}'.format(date | int) %}
          {% if date in ('1', '21', '31') %}
            {% set date = date ~ 'st' %}
          {% elif date in ('2', '22') %}
            {% set date = date ~ 'nd' %}
          {% elif date in ('3', '23') %}
            {% set date = date ~ 'rd' %}
          {% else %}
            {% set date = date ~ 'th' %}
          {% endif %}

          {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%H:%M on %a') }} {{ date }} {{ as_timestamp(states('sensor.last_boot')) | timestamp_custom('%b %Y') }}

      #=========================
      #=== Up Time =============
      #=========================

      nuc_uptime:
        friendly_name: NUC Uptime
        value_template: >
          {% set up_time = as_timestamp(now()) - as_timestamp(states('sensor.last_boot')) %}

          {% set minutes = (up_time // 60) | int %}
          {% set hours = (minutes // 60) %}
          {% set days = (hours // 24) %}
          {% set weeks = (days // 7) %}

          {% set minutes = (minutes % 60) %}
          {% set hours =  (hours % 24) %}
          {% set days = (days % 7) %}

          {% macro phrase(value, name) %}
                    {%- set value = value %}
                    {%- set end = 's' if value > 1 else '' %}
                    {{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
          {%- endmacro %}
                    
          {% set text = [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min') ] | select('!=','') | list | join(', ') %}
          {% set last_comma = text.rfind(',') %}
          {% if last_comma != -1 %}
            {% set text = text[:last_comma] + ' and' + text[last_comma + 1:] %}
          {% endif %}
          
          {{ text }}
1 Like