At this stage we have a utility meter setup that has 4 possible states. When switched to any of those states it will record electricity usage under that tariff and can use the cost per KWh to determine how much it has cost. What we want to do now is combine all of the work done so far and automate the changing of the tariffs based on the times we have set.
We are going to create our first automation. While this can be done by editing a YAML file, seeing it done through a GUI will make it easier to understand.
We are going to do this process 6 times. 1 for each of the times we need to change the tariff being charged.
Go to Settings.

Select Automations & Scenes.

Select CREATE AUTOMATION in the lower right corner.

Select Create new automation.

Select ADD TRIGER under When.

Select Time and location.

Select Time.

Select Value of a date/time helper or timestamp class sensor and for At time select Electricity Night Boost Tariff Start.

Under Then do select + ADD ACTION.

Select the Select option

Again select the Select sub option.

For Targets select Chose entity.

Select Utility Meter Tariff.

For Option put in nightboost and click SAVE.

In the prompt Name* add Automate Electricity Night Boost Tariff Start and for Description add Set the electricity tariff to Night Boost cost.

Click the back left arrow.

You should now have the automation set up.

Now repeat this process 5 times using the following details. You already have the 1st one complete so setup rules 2 to 6.
| Rule | Time | Option | Name | Description |
|---|---|---|---|---|
| 1 | Electricity Night Boost Tariff Start | nightboost | Automate Electricity Night Boost Tariff Start | Set the electricity tariff to Night Boost cost |
| 2 | Electricity Morning Tariff Start | night | Automate Electricity Morning Tariff Start | Set the electricity tariff to Night cost |
| 3 | Electricity Day Tariff Start | day | Automate Electricity Day Tariff Start | Set the electricity tariff to Day cost |
| 4 | Electricity Peak Tariff Start | peak | Automate Electricity Peak Tariff Start | Set the electricity tariff to Peak cost |
| 5 | Electricity Evening Tariff Start | day | Automate Electricity Evening Tariff Start | Set the electricity tariff to Day cost |
| 6 | Electricity Night Tariff Start | night | Automate Electricity Night Tariff Start | Set the electricity tariff to Night cost |
You should now have the 6 automations setup.

At this stage you have automated the changing of the tariffs. In the next stage we will Update Energy Dashboard with Cost




