Giter Club home page Giter Club logo

prusa_mini_home_assistant's Introduction

Prusa Mini Integration for Home Assistant

MIT License hacs_badge Hits

This integration allows you to get current state of the printer via API used by Prusa Connect Web Interface. Customizable pooling time and values to monitor.

Manual instalation

  • Create custom_components folder in your config folder (there is configuration.yaml located)
  • Create prusa_connect folder inside custom_components
  • Get repository
  • Unpack /custom_components/prusa_connect to /config/custom_components/prusa_connect
  • Add entry in configuration.yaml as below
  • Restart Home Assistant

HACS instalation

Configuration

Add lines shown below into your configuration.yaml Remeber to set printer IP and choose what conditions you want to monitor in HA.

sensor:
 - platform: prusa_connect
   host: 10.10.0.5          # set printer ip
   name: Prusa Mini         
   scan_interval: 30         # set refresh interval (seconds)
   monitored_conditions:
    - status                # return printer state: printing, online, offline, cooling, heating
    - temp_nozzle           # return nozzle temperature
    - temp_bed              # return bed temperature
    - material              # return current loaded material
    - progress              # return printing progress 0-100
    - time_est              # return estimated time to complete (minutes)
    - project_name          # return printing job filename
    - pos_z_mm              # return z height in mm (floating point)
    - time_tts              # return time readable by google assistant
    - print_dur             # return print duration

prusa_mini_home_assistant's People

Contributors

caiosweet avatar iridris avatar lwille avatar sq3tle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prusa_mini_home_assistant's Issues

Error: No 'version' key in the manifest file for custom integration 'prusa_connect'

Is your feature request related to a problem? Please describe.
I am getting an error on Home assistant (core-2021.4.3, supervisor-2021.03.9)
"No 'version' key in the manifest file for custom integration 'prusa_connect'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'prusa_connect'"

Describe the solution you'd like
I would like the error to be solved before "Home Assistant 2021.6" Since I like the use this addon

Additional context
The error code said to report this to the maintainer of 'prusa_connect'

print_dur not found

Describe the bug
I tried to install this integration as described in the readme, but upon restarting HA from the Web UI I get the following error:

[548091781072] The system cannot restart because the configuration is not valid: Invalid config for [sensor.prusa_connect]: value must be one of ['material', 'pos_z_mm', 'progress', 'project_name', 'status', 'temp_bed', 'temp_nozzle', 'time_est', 'time_tts'] @ data['monitored_conditions'][9]. Got 'print_dur'. (See ?, line ?).

Removing print_dur from the config solves the error. I see in the commit that this was only added lately, so is there a problem with my HACS not installing the latest version or was this not yet released?

To Reproduce

  1. Install integration via HACS
  2. restart, so HA finds the integration
  3. copy config from README and update IP address
  4. try to restart

Expected behavior
HA restarts and picks up the new integration

Screenshots
If applicable, add screenshots to help explain your problem.

Server:

  • OS: raspberian
  • HA: 2022.4.3
  • docker?: yes

Unique id

Is your feature request related to a problem? Please describe.
Can't add area to sensors in the UI because they don't have a unique id.

Describe the solution you'd like
Generate unique id for the sensors.

Describe alternatives you've considered

Additional context
IMG_20211224_012428

prusa_mini_home_assistant is not a valid add-on repository

Describe the bug
I'm getting an error when I try to add "https://github.com/sq3tle/prusa_mini_home_assistant" into Custom repositories in Home assistant

To Reproduce
Steps to reproduce the behavior:

  1. Supervisor -> Add-on Store -> Manage add-on repositories
  2. add repository: "https://github.com/sq3tle/prusa_mini_home_assistant"
  3. Error "Not a valid add-on repository"

Expected behavior
I expected to have the add on available to install

Server:

  • HA: 0.113.1
  • Raspi 4

Error from system log
20-11-23 09:03:17 INFO (MainThread) [supervisor.store.git] Cloning add-on https://github.com/sq3tle/prusa_mini_home_assistant repository
20-11-23 09:03:18 ERROR (MainThread) [supervisor.utils.json] Can't read json from /data/addons/git/fdae3219/repository.json: [Errno 2] No such file or directory: '/data/addons/git/fdae3219/repository.json'
20-11-23 09:03:18 ERROR (MainThread) [supervisor.store] https://github.com/sq3tle/prusa_mini_home_assistant is not a valid add-on repository.
20-11-23 09:03:18 INFO (MainThread) [supervisor.store.git] Removing custom add-on repository https://github.com/sq3tle/prusa_mini_home_assistant

Temperature sensors not inheriting SensorEntity warning in HA 2022.4

Describe the bug
Starting with HA 2022.4 release, log entries are listed on HA startup stating that a couple of the temperature sensors are not inheriting SensorEntity, which will be unsupported starting in HA 2022.7.

To Reproduce
Steps to reproduce the behavior:

  1. Update to HA 2022.4
  2. View logs
  3. See the warning message about the temperature sensors.

Expected behavior
No warnings.

Screenshots

Server:

  • OS: HA OS
  • HA: core 2022.4.b6
  • docker?: no

Additional context
Logs:

Temperature sensor sensor.prusa_mini_temp_nozzle (<class 'custom_components.prusa_connect.sensor.PrusaSensor'>) does not inherit SensorEntity, this will be unsupported in Home Assistant Core 2022.7.Please report it to the custom component author.
Temperature sensor sensor.prusa_mini_temp_bed (<class 'custom_components.prusa_connect.sensor.PrusaSensor'>) does not inherit SensorEntity, this will be unsupported in Home Assistant Core 2022.7.Please report it to the custom component author.

It would be nice if the unit_of_measurement could be natively included

My workaround was editing the customize.yaml:

  sensor.prusa_mini_temp_nozzle:
    friendly_name: "Nozzle Temperature"
    unit_of_measurement: "ºC"
  
  sensor.prusa_mini_temp_bed:
    friendly_name: "Bed Temperature"
    unit_of_measurement: "ºC"

  sensor.prusa_mini_pos_z_mm:
    friendly_name: "Current Z"
    unit_of_measurement: "mm"

  sensor.prusa_mini_progress:
    friendly_name: "Print Progress"
    unit_of_measurement: "%"

Error while setting up / KeyError: 'time_tts'

Describe the bug
Integration not starting up because of KeyError

To Reproduce
Steps to reproduce the behavior:

  1. Follow README (only changes were the IP and name of the printer)
  2. Restart Home Assistant
  3. See error in log

Expected behavior
Integration starts up without error

Server:

  • OS: Raspbian GNU/Linux 10 (buster)
  • HA: 0.118.3
  • docker: yes
  • Version 1.1c

Error Log:

2020-11-29 01:00:22 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up prusa_connect platform for sensor                                                                          
Traceback (most recent call last):                                                                                                                                                                         
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 207, in _async_setup_platform                                                                                               
    await asyncio.gather(*pending)                                                                                                                                                                         
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities                                                                                                  
    await asyncio.gather(*tasks)                                                                                                                                                                           
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity                                                                                                   
    await entity.add_to_platform_finish()                                                                                                                                                                  
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish                                                                                                       
    self.async_write_ha_state()                                                                                                                                                                            
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state                                                                                                         
    self._async_write_ha_state()                                                                                                                                                                           
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state                                                                                                        
    sstate = self.state                                                                                                                                                                                    
  File "/config/custom_components/prusa_connect/sensor.py", line 67, in state                                                                                                                              
    return self.inst.attributes[self.v_name]                                                                                                                                                               
KeyError: 'time_tts'     

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.