tr1plus / ha-aftership

Aftership state card for use in HomeAssistant
MIT License
16 stars 1 forks source link

aftership component not working - lovelace UI not supported #1

Closed vMeph closed 6 years ago

vMeph commented 6 years ago

all im getting is: 1

on my configuration.yaml have set

sensor:
  #Package tracking aftership
  - platform: rest
    name: AfterShip Sensor
    resource: https://api.aftership.com/v4/trackings/
    value_template: '{{ value_json["data"]["count"]}}'
    json_attributes:
      - data
    headers:
      aftership-api-key: !secret afteship
      Content-Type: application/json

copy state-card-aftership to the directory config\www\custom_ui

in groups:

tracks:
  name: Tracking
  entities:
    - sensor.aftership_sensor

have set the correct aftership api, if you notice in the pic shows 2 items availabe witch is correct

not sure what im doing wrong, im using HASSIO

tr1plus commented 6 years ago

Forgot to add the following in the documentation (ReadMe). I will update this in a bit.

Add the following to your configuration.yaml

frontend:
  extra_html_url:
    - /local/custom_ui/state-card-aftership.html

under customization.yaml (or in your configuration.yaml depending on how you set things up)

##aftership
sensor.aftership_sensor:
 custom_ui_state_card: state-card-aftership

Thanks for pointing this out, completely forgot about adding this part :) Let me know if it works!

vMeph commented 6 years ago

still didnt work, maybe something more still missing? still getting the same result

tr1plus commented 6 years ago

Just to verify: did you rename your sensor under the customize section? I also see you are using hass.io. Not sure if anything else is required there (never used it) Are you getting any errors in the error log by any chance?

Already tried giving a crtl+f5 (refresh cache)?

vMeph commented 6 years ago

no idea already did everything not sure what could be missing or wrong hopefully others will test it and post results

tr1plus commented 6 years ago

Very weird indeed. I don't see anything else that I would have done during my set-up. I don't think hass io would have impact on this so let's ignore that. I had the same issue while building and my issue turned out to be permission errors. Could you double check the www/custom_ui/state-card-aftership.html is in the correct location and has the same authorizations as your configuration.yaml?

vMeph commented 6 years ago

ok it seems that when i click on sensor now im getting this info 1

tr1plus commented 6 years ago

Okay that is good, could you try running it in incognito mode just to verify cache isn't an issue?

vMeph commented 6 years ago

i already have clean all cache and nothing what you mean by ruining in incognito mode?

tr1plus commented 6 years ago

You can run google chrome in incognito mode (which is a mode where cache, cookies, ... aren't saved) As you are able to see the correct output when clicking on it I find it very amusing that it is not visible in the front end.

What browser are you using. To be honest I only checked this with google chrome. Edit: in Edge it is also working for me

vMeph commented 6 years ago

using chrome just did in incognito mode and same

tr1plus commented 6 years ago

Tomorrow, I'll try to get a clean install of hass on one of my other pis. I'll let you know if I run into any similar issues.

vMeph commented 6 years ago

sounds great mate, that way will know for sure if is a hass problem or something im missing and didnt detect yet... by the way great job you doing thanks

vMeph commented 6 years ago

@tr1plus all seems to be working fine, it seems that isnt working with the new lovelace UI frontend https://gist.github.com/ciotlosm/9508388876edf92c4c1f3579e740fbd5 forgot to mention that i was using this new frontend, but i have test the standar frontend and all is working fine

tr1plus commented 6 years ago

I see. To be honest I haven't played around with the new UI (I started working on this the day before they announced lovelace would be included in the release). I may check out how to make it work for lovelace, but that will probably be for after my holidays.

closing, let me know if there is anything else!

vMeph commented 6 years ago

hi @tr1plus you think you could give it a shoot and try to make this card be compatible with lovelace? i have asked in the lovelace repo why could it be the owner says cause is custom card needs to have a update https://github.com/ciotlosm/docs-lovelace/issues/13

thanks

tr1plus commented 6 years ago

Currently on holiday. Will check it out after ☺

vMeph commented 6 years ago

Thanks mate Enjoy your holidays :)

tr1plus commented 6 years ago

@vMeph , initial lovelace version is available. Little bit less fancy but gets the job done for now :) When I make changes you should only have to update the js file under www/custom_ui so no huge effort!

vMeph commented 6 years ago

1

looking cool needs a bit center letter but awesome work you did thanks alot for this initial version :)

tr1plus commented 6 years ago

I created #2 for additional features. Let me know if there is anything else you want there :)